X. Sun

14 papers A 1Journal 8Unranked 5
YearRankTypeTitle / Venue / Authors
2017 conf
ESSDERC
Eduard Cartier, Atreya Majumdar, K.-T. Lee, Takashi Ando, Martin M. Frank, John Rozen, Keith A. Jenkins, C. Liang, C.-W. Cheng, John Bruley, M. Hopstaken, Pranita Kerber, J.-B. Yau, X. Sun, Renee T. Mo, Chun-Chen Yeh, Effendi Leobandung, Vijay Narayanan
2017 conf
NEMS
J. W. Berenschot, X. Sun, Hai Le The, R. M. Tiggelaar, M. J. de Boer, Jan C. T. Eijkel, J. G. E. Gardeniers, Niels R. Tas, Edin Sarajlic
2015 conf
ICICDT
A. Rouhi Najaf Abadi, W. Guo, X. Sun, K. Ben Ali, Jean-Pierre Raskin, Martin Rack, C. Roda Neve, M. Choi, V. Moroz, Geert Van der Plas, Ingrid De Wolf, Eric Beyne, Philippe P. Absil
2014 conf
3DIC
X. Sun, Geert Van der Plas, Mikael Detalle, Eric Beyne
2012 J jnl
IBM J. Res. Dev.
X. Sun, L. Xu, Y. Yu, Y. Pan
2012 J jnl
J. Syst. Control. Eng.
X. Wang, X. Sun, Shihua Li, H. Ye
2011 J jnl
IEEE Syst. J.
Zhijun Fang, Naixue Xiong, Laurence Tianruo Yang, X. Sun, Yan Yang
2009 conf
MUE
X. Sun, Qing W. Hu, Hua Y. Wu
2009 J jnl
J. Complex.
Steven B. Damelin, Jeremy Levesley, David L. Ragozin, X. Sun
2006 J jnl
J. Approx. Theory
Jeremy Levesley, X. Sun
2005 J jnl
J. Approx. Theory
Jeremy Levesley, X. Sun
2005 J jnl
SIAM J. Matrix Anal. Appl.
Shiv Chandrasekaran, Patrick M. Dewilde, Ming Gu, T. Pals, X. Sun, Alle-Jan van der Veen, Daniel White
2000 J jnl
J. Chem. Inf. Comput. Sci.
E. H. Zhao, K. Chen, H. Jiang, X. Sun, Thomas F. George
1997 A conf
ITC
J. Li, X. Sun, K. Soon
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