Rafal Krenz

14 papers B 5Journal 4Unranked 5
YearRankTypeTitle / Venue / Authors
2020 conf
VTC Spring
Rafal Krenz, Michal Sybis, Pawel Sroka, Krzysztof Wesolowski
2018 conf
CSNDSP
Rafal Krenz, Michal Sybis
2017 J jnl
IEEE Commun. Mag.
Rafal Krenz
2016 conf
CSNDSP
Rafal Krenz, Marcin Rodziewicz
2015 conf
BlackSeaCom
Rafal Krenz, Soumya Brahma
2013 J jnl
Wirel. Pers. Commun.
Rafal Krenz
2012 conf
CSNDSP
Rafal Krenz
2009 J jnl
Eur. Trans. Telecommun.
Rafal Krenz
2004 B conf
PIMRC
Rafal Krenz
2003 B conf
PIMRC
Rafal Krenz
2002 B conf
PIMRC
Rafal Krenz
1996 J jnl
Int. J. Wirel. Inf. Networks
Krzysztof Wesolowski, Rafal Krenz, Kay Das
1994 B conf
VTC
Rafal Krenz, Flavio Muratore, Giovanni Romano
1994 B conf
PIMRC
Rafal Krenz, Krzysztof Wesolowski
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