Hamid Mozaffari

11 papers A* 2Journal 6Unranked 3
YearRankTypeTitle / Venue / Authors
2025 J jnl
CoRR
Bargav Jayaraman, Virendra J. Marathe, Hamid Mozaffari, William F. Shen, Krishnaram Kenthapadi
2024 conf
ICKG
Arisa Tajima, Wei Jiang, Virendra J. Marathe, Hamid Mozaffari
2024 conf
ESORICS (1)
Hamid Mozaffari, Sunav Choudhary, Amir Houmansadr
2024 J jnl
CoRR
Hamid Mozaffari, Sunav Choudhary, Amir Houmansadr
2024 J jnl
CoRR
Hamid Mozaffari, Virendra J. Marathe
2023 A* conf
USENIX Security Symposium
Hamid Mozaffari, Virat Shejwalkar, Amir Houmansadr
2022 J jnl
CoRR
Hamid Mozaffari, Amir Houmansadr
2022 J jnl
CoRR
Hamid Mozaffari, Virendra J. Marathe, Dave Dice
2021 J jnl
CoRR
Hamid Mozaffari, Virat Shejwalkar, Amir Houmansadr
2020 A* conf
NDSS
Hamid Mozaffari, Amir Houmansadr
2019 conf
GLOBECOM Workshops
Hamid Mozaffari, Amir Houmansadr, Arun Venkataramani
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