Onno S. van Roosmalen

11 papers B 1Journal 6Unranked 4
YearRankTypeTitle / Venue / Authors
2001 B conf
ECRTS
A. Sintoski, Dieter K. Hammer, Onno S. van Roosmalen, Jozef Hooman
2000 J jnl
Real Time Syst.
Jozef Hooman, Onno S. van Roosmalen
2000 J jnl
Real Time Syst.
Jozef Hooman, Onno S. van Roosmalen
1998 J jnl
Parallel Distributed Comput. Pract.
Jozef Hooman, Onno S. van Roosmalen
1997 conf
WORDS
Jozef Hooman, Onno S. van Roosmalen
1996 J jnl
OOPS Messenger
Dieter K. Hammer, Lonnie R. Welch, Onno S. van Roosmalen
1996 conf
ECBS
Dieter K. Hammer, Onno S. van Roosmalen, Lonnie R. Welch
1996 conf
WORDS
Onno S. van Roosmalen, W. J. M. Lemmens
1996 J jnl
OOPS Messenger
Onno S. van Roosmalen
1994 conf
WORDS
Onno S. van Roosmalen
1994 J jnl
IEEE Parallel Distributed Technol. Syst. Appl.
Dieter K. Hammer, Erik J. Luit, Onno S. van Roosmalen, Peter van der Stok, Jack P. C. Verhoosel
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