Osamu Hasegawa

124 papers A* 5A 6B 20C 3Misc 9Journal 45Unranked 36
YearRankTypeTitle / Venue / Authors
2023 C conf
EJC
Takafumi Nakanishi, Ayako Minematsu, Ryotaro Okada, Osamu Hasegawa, Virach Sornlertlamvanich
2023 conf
TALE
Hiroto Yamakawa, Haruki Ueno, Kana Ohashi, Akihiro Matsuda, Osamu Hasegawa, Hiroshi Komatsugawa
2022 C conf
EJC
Takafumi Nakanishi, Ayako Minematsu, Ryotaro Okada, Osamu Hasegawa, Virach Sornlertlamvanich
2018 J jnl
J. Robotics Mechatronics
Ndivhuwo Makondo, Michihisa Hiratsuka, Benjamin Rosman, Osamu Hasegawa
2018 A* conf
ICRA
Ndivhuwo Makondo, Benjamin Rosman, Osamu Hasegawa
2018 Misc conf
SAC
Xiaoyu Wang, Osamu Hasegawa, Shiming Ge
2018 conf
ICONIP (2)
Wonjik Kim, Osamu Hasegawa
2018 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Wonjik Kim, Osamu Hasegawa
2018 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Wonjik Kim, Osamu Hasegawa
2017 Misc conf
MVA
Takahiro Terashima, Osamu Hasegawa
2017 B conf
IJCNN
Xiaoyu Wang, Osamu Hasegawa
2017 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Pei-Hua Huang, Osamu Hasegawa
2017 J jnl
IEEE Trans. Neural Networks Learn. Syst.
Yoshihiro Nakamura, Osamu Hasegawa
2017 conf
ICONIP (3)
Wonjik Kim, Osamu Hasegawa
2017 conf
RiTA
Putti Thaipumi, Osamu Hasegawa
2017 Misc conf
DICTA
Chayut Wiwatcharakoses, Osamu Hasegawa
2016 A conf
IROS
Michihisa Hiratsuka, Ndivhuwo Makondo, Benjamin Rosman, Osamu Hasegawa
2015 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Gangchen Hua, Osamu Hasegawa
2015 B conf
IJCNN
Pei-Hua Huang, Osamu Hasegawa
2015 B conf
IJCNN
Daiki Kimura, Osamu Hasegawa
2015 J jnl
Int. J. Comput. Intell. Appl.
Tarek Najjar, Osamu Hasegawa
2015 conf
Humanoids
Ndivhuwo Makondo, Benjamin Rosman, Osamu Hasegawa
2014 J jnl
IEEE Trans. Neural Networks Learn. Syst.
Hongwei Zhang, Xiong Xiao, Osamu Hasegawa
2013 J jnl
Neurocomputing
Furao Shen, Qiubao Ouyang, Wataru Kasai, Osamu Hasegawa
2013 J jnl
Adv. Robotics
Aram Kawewong, Noppharit Tongprasit, Osamu Hasegawa
2013 conf
ICONIP (2)
Xiong Xiao, Hongwei Zhang, Osamu Hasegawa
2013 conf
HCI (8)
Osamu Hasegawa, Daiki Kimura
2013 A* conf
AAAI
Aram Kawewong, Rapeeporn Pimup, Osamu Hasegawa
2013 conf
ICONIP (2)
Yoshihiro Nakamura, Osamu Hasegawa
2013 conf
IWANN (1)
Tarek Najjar, Osamu Hasegawa
2013 A* conf
HRI
Daiki Kimura, Ryutaro Nishimura, Akihiro Oguro, Osamu Hasegawa
2012 J jnl
Signal Process. Image Commun.
Sirinart Tangruamsub, Keisuke Takada, Osamu Hasegawa
2012 B conf
ICIP
Rapeeporn Pimup, Aram Kawewong, Osamu Hasegawa
2012 A* conf
CVPR
Pichai Kankuekul, Aram Kawewong, Sirinart Tangruamsub, Osamu Hasegawa
2012 J jnl
IEICE Trans. Inf. Syst.
Sirinart Tangruamsub, Aram Kawewong, Manabu Tsuboyama, Osamu Hasegawa
2011 A conf
WACV
Sirinart Tangruamsub, Keisuke Takada, Osamu Hasegawa
2011 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Shigeki Nagaya, Chenli Zhang, Osamu Hasegawa
2011 J jnl
Neural Comput. Appl.
Furao Shen, Hui Yu, Keisuke Sakurai, Osamu Hasegawa
2011 conf
ICONIP (3)
Aram Kawewong, Yuji Koike, Osamu Hasegawa, Fumio Sato
2011 B conf
IJCNN
Aram Kawewong, Sirinart Tangruamsub, Pichai Kankuekul, Osamu Hasegawa
2011 J jnl
Int. J. Robotics Res.
Aram Kawewong, Noppharit Tongprasit, Sirinart Tangruamsub, Osamu Hasegawa
2011 J jnl
Robotics Auton. Syst.
Aram Kawewong, Noppharit Tongprasit, Osamu Hasegawa
2011 A conf
WACV
Noppharit Tongprasit, Aram Kawewong, Osamu Hasegawa
2011 A conf
IROS
Hiroshi Morioka, Sangkyu Yi, Osamu Hasegawa
2010 conf
ICONIP (2)
Hui Yu, Furao Shen, Osamu Hasegawa
2010 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Furao Shen, Hui Yu, Youki Kamiya, Osamu Hasegawa
2010 B conf
IJCNN
Furao Shen, Hui Yu, Wataru Kasai, Osamu Hasegawa
2010 J jnl
Neural Networks
Furao Shen, Akihito Sudo, Osamu Hasegawa
2010 conf
ICANN (3)
Aram Kawewong, Osamu Hasegawa
2010 conf
ICANN (3)
Kazuhiro Yamasaki, Naoya Makibuchi, Furao Shen, Osamu Hasegawa
2010 conf
ICANN (3)
Shogo Okada, Osamu Hasegawa, Toyoaki Nishida
2010 conf
ICANN (3)
Naoya Makibuchi, Furao Shen, Osamu Hasegawa
2010 J jnl
IEICE Trans. Inf. Syst.
Aram Kawewong, Sirinart Tangruamsub, Osamu Hasegawa
2010 J jnl
IEICE Trans. Inf. Syst.
Aram Kawewong, Yutaro Honda, Manabu Tsuboyama, Osamu Hasegawa
2010 conf
ICANN (3)
Furao Shen, Osamu Hasegawa
2010 conf
ICANN (3)
Sirinart Tangruamsub, Manabu Tsuboyama, Aram Kawewong, Osamu Hasegawa
2009 conf
ICANN (1)
Wataru Kasai, Yutaro Tobe, Osamu Hasegawa
2009 conf
ICANN (2)
Shigeki Nagaya, Chenli Zhang, Osamu Hasegawa
2009 B conf
PAKDD
Ye Xu, Furao Shen, Osamu Hasegawa, Jinxi Zhao
2009 J jnl
IEEE Trans. Neural Networks
Akihito Sudo, Akihiro Sato, Osamu Hasegawa
2009 conf
ICONIP (1)
Noppharit Tongprasit, Aram Kawewong, Osamu Hasegawa
2009 B conf
IJCNN
Sirinart Tangruamsub, Manabu Tsuboyama, Aram Kawewong, Osamu Hasegawa
2009 A conf
CIKM
Ye Xu, Furao Shen, Jinxi Zhao, Osamu Hasegawa
2009 C conf
CAIP
Aram Kawewong, Sirinart Tangruamsub, Osamu Hasegawa
2008 conf
ICONIP (1)
Aram Kawewong, Yutaro Honda, Manabu Tsuboyama, Osamu Hasegawa
2008 J jnl
Neural Networks
Furao Shen, Osamu Hasegawa
2008 conf
ROBIO
Aram Kawewong, Yutaro Honda, Manabu Tsuboyama, Osamu Hasegawa
2008 B conf
ICPR
Shogo Okada, Osamu Hasegawa
2008 B conf
IJCNN
Shogo Okada, Osamu Hasegawa
2008 J jnl
IEEE Trans. Pattern Anal. Mach. Intell.
Takahiro Toyoda, Osamu Hasegawa
2007 B conf
IJCNN
Shen Furao, Osamu Hasegawa
2007 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Youki Kamiya, Shen Furao, Osamu Hasegawa
2007 B conf
IJCNN
Youki Kamiya, Toshiaki Ishii, Shen Furao, Osamu Hasegawa
2007 B conf
IJCNN
Shen Furao, Keisuke Sakurai, Youki Kamiya, Osamu Hasegawa
2007 J jnl
Neural Networks
Shen Furao, Tomotaka Ogura, Osamu Hasegawa
2007 B conf
IJCNN
Akihito Sudo, Akihiro Sato, Osamu Hasegawa
2007 conf
ICANN (2)
Shogo Okada, Osamu Hasegawa
2007 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Aram Kawewong, Osamu Hasegawa
2007 J jnl
IEEE Trans. Syst. Man Cybern. Part B
Xiaoyuan He, Tomotaka Ogura, Akihiro Satou, Osamu Hasegawa
2007 J jnl
IEEE Trans. Syst. Man Cybern. Part B
Xiaoyuan He, Ryo Kojima, Osamu Hasegawa
2007 J jnl
Pattern Recognit.
Takahiro Toyoda, Osamu Hasegawa
2007 conf
ICONIP (1)
Akihito Sudo, Manabu Tsuboyama, Chenli Zhang, Akihiro Sato, Osamu Hasegawa
2006 conf
CVPR (2)
Shinji Hayashi, Osamu Hasegawa
2006 J jnl
Neural Networks
Furao Shen, Osamu Hasegawa
2006 J jnl
Neural Networks
Shen Furao, Osamu Hasegawa
2006 conf
ACCV (1)
Shinji Hayashi, Osamu Hasegawa
2006 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Shogo Okada, Osamu Hasegawa
2006 conf
CVPR (1)
Takahiro Toyoda, Keisuke Tagami, Osamu Hasegawa
2006 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Shinji Hayashi, Osamu Hasegawa
2006 B conf
RO-MAN
Shogo Okada, Osamu Hasegawa
2005 conf
ICIP (2)
Aram Kawewong, Osamu Hasegawa
2005 conf
CVPR (1)
Shen Furao, Osamu Hasegawa
2005 Misc conf
MVA
Shinji Hayashi, Osamu Hasegawa
2005 Misc conf
ISVC
Shinji Hayashi, Osamu Hasegawa
2005 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Shen Furao, Osamu Hasegawa
2005 J jnl
Mach. Vis. Appl.
Osamu Hasegawa, Takeo Kanade
2004 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Furao Shen, Osamu Hasegawa
2004 J jnl
Signal Process. Image Commun.
Furao Shen, Osamu Hasegawa
2004 B conf
IJCNN
Shen Furao, Osamu Hasegawa
2004 B conf
ICONIP
Furao Shen, Osamu Hasegawa
2004 B conf
ICIP
Furao Shen, Osamu Hasegawa
2004 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Kohta Aoki, Osamu Hasegawa, Hiroshi Nagahashi
2004 J jnl
J. Adv. Comput. Intell. Intell. Informatics
Osamu Hasegawa
2003 conf
CIRA
Kohta Aoki, Ken'ichi Morooka, Osamu Hasegawa, Hiroshi Nagahashi
2003 conf
CVPR Workshops
Yousun Kang, Osamu Hasegawa, Hiroshi Nagahashi
2002 A conf
WACV
Osamu Hasegawa, Takio Kurita
2002 Misc conf
MVA
Osamu Hasegawa, Takio Kurita
2002 Misc conf
MVA
Osamu Hasegawa, Takeo Kanade
2000 Misc conf
MVA
Nobuyoshi Enomoto, Takeo Kanade, Hironobu Fujiyoshi, Osamu Hasegawa
2000 B conf
ICMI
Ming Xu, Bisser Raytchev, Katsuhiko Sakaue, Osamu Hasegawa, Atsuko Koizumi, Masaru Takeuchi, Hirohiko Sagawa
2000 J jnl
New Gener. Comput.
Osamu Hasegawa, Katsuhiko Sakaue, Satoru Hayamizu
2000 J jnl
New Gener. Comput.
Bisser Raytchev, Osamu Hasegawa, Nobuyuki Otsu
2000 J jnl
Pattern Recognit. Lett.
Bisser Raytchev, Osamu Hasegawa, Nobuyuki Otsu
1998 Misc conf
MVA
Bisser Raytchev, Osamu Hasegawa, Nobuyuki Otsu
1997 conf
Gesture Workshop
Shuichi Nobe, Satoru Hayamizu, Osamu Hasegawa, Hideaki Takahashi
1996 conf
ICSLP
Satoru Hayamizu, Osamu Hasegawa, Katunobu Itou, Katsuhiko Sakaue, Kazuyo Tanaka, Shigeki Nagaya, Masayuki Nakazawa, T. Endoh, Fumio Togawa, Kenji Sakamoto, Kazuhiko Yamamoto
1995 A* conf
IJCAI
Osamu Hasegawa, Katsunobu Itou, Takio Kurita, Satoru Hayamizu, Kazuyo Tanaka, Kazuhiko Yamamoto, Nobuyuki Otsu
1995 J jnl
Mach. Vis. Appl.
Osamu Hasegawa, Chil-Woo Lee, Wiwat Wongwarawipat, Mitsuru Ishizuka
1994 conf
ICSLP
Katunobu Itou, Tomoyosi Akiba, Osamu Hasegawa, Satoru Hayamizu, Kazuyo Tanaka
1994 conf
ICPR (3)
Osamu Hasegawa, Kazuhiko Yokosawa, Mitsuru Ishizuka
1994 J jnl
Syst. Comput. Jpn.
Osamu Hasegawa, Mitsuru Ishizuka, Kazuhiko Yokosawa
1992 conf
ICPR (4)
Osamu Hasegawa, Chil-Woo Lee, Wiwat Wongwarawipat, Mitsuru Ishizuka
1991 J jnl
J. Vis. Commun. Image Represent.
Chil-Woo Lee, Osamu Hasegawa, Wiwat Wongwarawipat, Hiroshi Dohi, Mitsuru Ishizuka
1989 B conf
SMC
Toshio Fukuda, Osamu Hasegawa
redb/extractors/decompiler/bninja/analysis/cfg-old.py
← Index redb/extractors/decompiler/bninja/analysis/cfg-old.py python
from collections import deque
from enum import Enum

from binaryninja.enums import (
    BranchType,
    InstructionTextTokenType,
)

# Support both package and standalone imports
try:
    from ..utils.hashes import calculate_md5, calculate_sha256
except ImportError:
    # Fallback to absolute imports (for multiprocessing spawned processes)
    from redb.extractors.decompiler.bninja.utils.hashes import calculate_md5, calculate_sha256


class CFGAnalysis:
    def __init__(self, function):
        self.function = function

    def determine_block_type(self, block) -> str:
        """Determine the type of a basic block."""
        # Check if it's a thunk function (usually just a jump or call)
        if len(block.disassembly_text) <= 2 and any(
            "jmp" in line.tokens[0].text.lower() for line in block.disassembly_text
        ):
            return "THUNK"

        # Check if it contains only data (no valid instructions)
        if all(not line.tokens for line in block.disassembly_text):
            return "DATA"

        # Default to code
        return "CODE"

    def extract_cyclomatic_complexity(self):
        """
        Cyclomatic complexity (McCabe’s metric) measures the number of linearly independent paths
        through a function’s control flow graph (CFG).
        The standard formula is:

            M = E - N + 2

        where:
            - E = number of edges in the CFG
            - N = number of nodes (basic blocks)
            - 2 accounts for the entry and exit nodes of a single connected graph
        """
        if self.function is None:
            return 0

        # number of basic blocks
        num_blocks = len(self.function.basic_blocks)
        # number of edges in the graph
        num_edges = sum(
            len(basic_block.outgoing_edges)
            for basic_block in self.function.basic_blocks
        )
        return num_edges - num_blocks + 2

    def extract_function_cfg(self):
        """Extract information about a function CFG and return it as a dictionary."""

        function = self.function
        function_data = {
            "function_address": self.function.start,
            "blocks": [],
            "measures": {
                "cyclomatic_complexity": self.extract_cyclomatic_complexity(),
            },
        }

        if self.function is None:
            return function_data

        # Get the map of the depth associated to every block
        depths = self.get_map_depth()

        # Get the map of the positions associated to every block
        id_maps = self.get_block_id_map()

        # Extract block data with graph structure information
        for block in function.basic_blocks:
            # dominators per every block translated
            dominators = sorted(self.extract_dominators(block, id_maps))

            # post dominators
            post_dominators = sorted(self.extract_post_dominators(block, id_maps))

            # Build block instructions string
            block_instructions = "\n".join(str(line) for line in block.disassembly_text)

            # Determine block type
            block_type = self.determine_block_type(block)

            # Extract successors directly from basic block
            successor_blocks = [edge.target.start for edge in block.outgoing_edges]
            # We ensure a canonical order and we sort the edges
            successor_blocks.sort()

            # Extract predecessors directly from basic block
            predecessor_blocks = [edge.source.start for edge in block.incoming_edges]
            # We ensure a canonical order and we sort the edges
            predecessor_blocks.sort()

            # Determine branch type from outgoing edges
            branch_type = self.determine_branch_type(block)

            instructions_count = len(block.disassembly_text)

            # Create block record
            block_json = {
                "function_address": self.function.start,
                "block_start_address": block.start,
                "block_end_address": block.end,
                "block_size": block.end - block.start,
                "instructions_count": instructions_count,
                "block_instructions_hash": calculate_sha256(block_instructions),
                "predecessor_blocks": predecessor_blocks,
                "successor_blocks": successor_blocks,
                "depth": depths[block.start],
                "position": id_maps[block.start],
                "branch_type": branch_type,
                "block_type": block_type,
                "flags": self.extract_block_flags(block),
                "dominators": dominators,
                "post_dominators": post_dominators,
            }
            function_data["blocks"].append(block_json)

        return function_data

    def extract_dominators(self, bb, id_maps):
        """Extract the dominators normalized"""
        dom_idx = [id_maps[d.start] for d in bb.dominators]
        return dom_idx

    def extract_post_dominators(self, bb, id_maps):
        """Extract the post-dominators normalized"""
        post_dom_idx = [id_maps[d.start] for d in bb.post_dominators]
        return post_dom_idx

    def determine_branch_type(self, block):
        """
        Determine the type of branch at the end of a basic block.
        This combines edge type information with instruction analysis.
        """
        # If no outgoing edges, it might be a return or terminal block
        if not block.outgoing_edges:
            # Check if the last instruction is a return
            for line in reversed(list(block.disassembly_text)):
                if line.tokens and any(
                    token.text.lower() in ["ret", "retn"] for token in line.tokens
                ):
                    return "RETURN"
            return "UNKNOWN"

        # Collect branch types from all outgoing edges
        branch_types = []
        for edge in block.outgoing_edges:
            edge_type = edge.type
            # Map edge type to our branch type enum
            if isinstance(edge_type, str):
                if edge_type == "IndirectCall":
                    branch_types.append("CALL")
                else:
                    branch_types.append("UNKNOWN")
            else:
                # Use our mapping for integer/enum values
                type_mapping = {
                    BranchType.UnconditionalBranch: "DIRECT",
                    BranchType.FalseBranch: "CONDITIONAL",
                    BranchType.TrueBranch: "CONDITIONAL",
                    BranchType.CallDestination: "CALL",
                    BranchType.FunctionReturn: "RETURN",
                    BranchType.SystemCall: "CALL",
                    BranchType.IndirectBranch: "INDIRECT",
                    BranchType.ExceptionBranch: "UNKNOWN",
                    BranchType.UnresolvedBranch: "UNKNOWN",
                    BranchType.UserDefinedBranch: "UNKNOWN",
                }
                branch_types.append(type_mapping.get(edge_type, "UNKNOWN"))

        # Determine overall branch type (prioritize CALL > RETURN > CONDITIONAL > DIRECT)
        if "CALL" in branch_types:
            return "CALL"
        elif "RETURN" in branch_types:
            return "RETURN"
        elif "CONDITIONAL" in branch_types:
            return "CONDITIONAL"
        elif "DIRECT" in branch_types:
            return "DIRECT"
        elif len(block.outgoing_edges) == 1:
            return "FALLTHROUGH"

        # If edge analysis was inconclusive, fall back to instruction analysis
        last_instr = None
        for line in reversed(list(block.disassembly_text)):
            if line.tokens:
                last_instr = line
                break

        if last_instr:
            mnemonic = None
            for token in last_instr.tokens:
                if token.type == InstructionTextTokenType.InstructionToken:
                    mnemonic = token.text.lower()
                    break

            if mnemonic:
                if mnemonic == "call":
                    return "CALL"
                elif mnemonic == "jmp":
                    return "DIRECT"
                elif mnemonic.startswith("j") and mnemonic != "jmp":
                    return "CONDITIONAL"
                elif mnemonic in ["ret", "retn"]:
                    return "RETURN"

        return "UNKNOWN"

    def get_map_depth(self):
        """
        Run a BFS on the basic blocks of the function to assign a depth to every block
        """

        depths = {}
        entry = self.function.get_basic_block_at(self.function.start)

        ### Simple BFS
        q = deque()
        q.append(entry)
        depths[entry.start] = 0

        while q:
            b = q.popleft()
            b_depth = depths[b.start]
            for edge in b.outgoing_edges:
                tgt = edge.target

                if tgt is None:
                    continue

                if tgt.start not in depths:
                    depths[tgt.start] = b_depth + 1
                    q.append(tgt)

        return depths

    def get_block_id_map(self):
        """
        Assign a unique, sequential ID to each basic block of the function using a BFS starting from the entry block.
        """

        id_map = {}
        entry = self.function.get_basic_block_at(self.function.start)

        q = deque()
        q.append(entry)

        current_id = 0
        id_map[entry.start] = current_id

        while q:
            b = q.popleft()
            for edge in b.outgoing_edges:
                tgt = edge.target

                if tgt is None:
                    continue

                if tgt.start not in id_map:
                    current_id += 1
                    id_map[tgt.start] = current_id
                    q.append(tgt)

        return id_map

    def extract_block_flags(self, block):
        """
        Get the flags for every basic block. Currently, we implemented these heuristics:
            - if a basic block is the entry node for a function
            - if a basic block is the exit block for a function
            - if a basic block is part of a natural loop
        """
        flags = []

        if block.start == self.function.start:
            flags.append(BlockFlags.EntryBlock.value)

        if any(edge.type == BranchType.FunctionReturn for edge in block.outgoing_edges):
            flags.append(BlockFlags.ExitBlock.value)

        # if this block is in its dominance frontier, then it's part of a natural loop
        if block in block.dominance_frontier:
            flags.append(BlockFlags.LoopBlock.value)

        return flags


class BlockFlags(Enum):
    # generally, the basic block identifying the entry point of the function
    EntryBlock = "EntryBlock"
    # any basic blocks that makes the control flow exiting from the current function
    ExitBlock = "ExitBlock"
    # any block is in a natural loop if it is in its own dominance frontier
    LoopBlock = "LoopBlock"


class BlockType(Enum):
    THUNK = "THUNK"
    DATA = "DATA"
    PADDING = "PADDING"
    CODE = "CODE"