Oliver T. W. Yu

14 papers A* 1A 3B 3C 1Journal 5Unranked 1
YearRankTypeTitle / Venue / Authors
2004 A conf
SC
Oliver T. W. Yu, Thomas A. DeFanti
2003 J jnl
Mob. Networks Appl.
Oliver T. W. Yu
2003 J jnl
Future Gener. Comput. Syst.
Eric He, Javid Alimohideen, Josh Eliason, Naveen K. Krishnaprasad, Jason Leigh, Oliver T. W. Yu, Thomas A. DeFanti
2002 conf
ICC
Oliver T. W. Yu, Shashank Khanvilkar
2002 C conf
CLUSTER
Eric He, Jason Leigh, Oliver T. W. Yu, Thomas A. DeFanti
2001 A conf
ICME
Oliver T. W. Yu
2000 A conf
IEEE International Conference on Multimedia and Expo (II)
Oliver T. W. Yu
2000 B conf
WCNC
Vijay K. Garg, Oliver T. W. Yu
2000 B conf
WCNC
Oliver T. W. Yu
1997 J jnl
IEEE J. Sel. Areas Commun.
Oliver T. W. Yu, Victor C. M. Leung
1996 J jnl
Mob. Networks Appl.
Oliver T. W. Yu, Victor C. M. Leung
1996 J jnl
Mob. Networks Appl.
Oliver T. W. Yu, Victor C. M. Leung
1996 A* conf
INFOCOM
Oliver T. W. Yu, Victor C. M. Leung
1995 B conf
PIMRC
Oliver T. W. Yu, Victor C. M. Leung
redb/extractors/decompiler/bninja/function_type.py
← Index redb/extractors/decompiler/bninja/function_type.py python
from enum import Enum

import binaryninja


class FunctionType(Enum):
    USER = "USER"
    LIBRARY = "LIBRARY"
    EXTERNAL = "EXTERNAL"
    THUNK = "THUNK"
    UNKNOWN = "UNKNOWN"


class FunctionTypeAnalysis:
    """Get the function kind based on the symbol type associated to this function"""

    def __init__(self, function):
        """Sets the function type dependent on the symbol type associated to this function. If
        any errors occur, then returns UNKNOWN
        """
        self.func_type = FunctionType.USER

        try:
            symbol_type = function.symbol.type
            # Check if it's an external function (there should not be, already skipping these)
            if symbol_type == binaryninja.enums.SymbolType.ImportedFunctionSymbol:
                self.func_type = FunctionType.EXTERNAL

            # Library functions detected by Binary Ninja
            if symbol_type == binaryninja.enums.SymbolType.LibraryFunctionSymbol:
                self.func_type = FunctionType.LIBRARY

            # Check if it's a thunk function
            if function.is_thunk:
                self.func_type = FunctionType.THUNK

        except Exception as _:
            self.func_type = FunctionType.UNKNOWN

    def get_function_type(self):
        return self.func_type