Nahid Mirzaie

12 papers Journal 4Unranked 8
YearRankTypeTitle / Venue / Authors
2021 conf
ISQED
Nahid Mirzaie, Ron Rohrer
2020 J jnl
IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.
Nahid Mirzaie, Ron Rohrer
2018 conf
CCWC
Nahid Mirzaie, Ahmed Alzahmi, Chung-Ching Lin, Gyung-Su Byun
2018 conf
EIT
Chung-Ching Lin, Ahmed Alzahmi, Nahid Mirzaie, Gyung-Su Byun
2018 J jnl
IEEE Trans. Very Large Scale Integr. Syst.
Nahid Mirzaie, Ahmed Alzahmi, Hossein Shamsi, Gyung-Su Byun
2017 conf
ISOCC
Nahid Mirzaie, Ahmed Alzahmi, Chung-Ching Lin, Insoo Kim, Gyung-Su Byun
2017 conf
UEMCON
Nahid Mirzaie, Ahmed Alzahmi, Chung-Ching Lin, Gyung-Su Byun
2017 J jnl
J. Circuits Syst. Comput.
Nahid Mirzaie, Hossein Shamsi, Gyung-Su Byun
2017 conf
ISOCC
Ahmed Alzahmi, Nahid Mirzaie, Chung-Ching Lin, Insoo Kim, Gyung-Su Byun
2017 conf
UEMCON
Ahmed Alzahmi, Nahid Mirzaie, Chung-Ching Lin, Gyung-Su Byun
2017 J jnl
Int. J. Circuit Theory Appl.
Nahid Mirzaie, Hossein Shamsi, Gyung-Su Byun
2010 conf
CDES
Nahid Mirzaie, Seyyed Javad Seyyed Mahdavi, Karim Mohammadi
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