How to use the bytecode.BuffHandle function in bytecode

To help you get started, we’ve selected a few bytecode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github androguard / androguard / core / bytecodes / jvm.py View on Github external
def _create_name_and_type(self, name_method_index, descriptor_method_index) :
        name_and_type_index = self.get_name_and_type_index( name_method_index, descriptor_method_index )
        if name_and_type_index == -1 :
            new_nat = CreateNameAndType( self, name_method_index, descriptor_method_index )
            self.add_constant_pool( NameAndType( self, bytecode.BuffHandle( new_nat.get_raw() ) ) )
            name_and_type_index = self.get_constant_pool_count() - 1
        return name_and_type_index
github itomsu / apk_parse3 / apk.py View on Github external
def __init__(self, raw_buff):
        self.reset()

        self.valid_axml = True
        self.buff = bytecode.BuffHandle(raw_buff)

        axml_file = unpack('
github tdoly / apk_parse / apk.py View on Github external
def __init__(self, raw_buff):
        self.reset()

        self.valid_axml = True
        self.buff = bytecode.BuffHandle(raw_buff)

        axml_file = unpack('
github androguard / androguard / core / bytecodes / apk.py View on Github external
def __init__(self, raw_buff) :
        self.reset()

        self.buff = bytecode.BuffHandle( raw_buff )

        self.buff.read(4)
        self.buff.read(4)

        self.sb = StringBlock( self.buff )

        self.m_resourceIDs = []
        self.m_prefixuri = {}
        self.m_uriprefix = {}
        self.m_prefixuriL = []
github MobSF / Mobile-Security-Framework-MobSF / StaticAnalyzer / tools / apkinfo / apk.py View on Github external
def __init__(self, raw_buff):
        self.analyzed = False
        self.buff = bytecode.BuffHandle(raw_buff)
        #print "SIZE", hex(self.buff.size())

        self.header = ARSCHeader(self.buff)
        self.packageCount = unpack('
github androguard / androguard / core / bytecodes / jvm.py View on Github external
def add_string(self, name) :
        name_index = self.get_string_index(name)
        if name_index != -1 :
            return name_index

        tag_value = INVERT_CONSTANT_INFO[ "CONSTANT_Utf8" ]
        buff = pack( CONSTANT_INFO[ tag_value ][1], tag_value, len(name) ) + pack( ">%ss" % len(name), name )
        ci = CONSTANT_INFO[ tag_value ][-1]( self, bytecode.BuffHandle( buff ) )

        self.constant_pool.append( ci )
        self.constant_pool_count.set_value( self.constant_pool_count.get_value() + 1 )

        return self.constant_pool_count.get_value() - 1
github linkedin / qark / qark / lib / axmlparserpy / axmlparser.py View on Github external
def __init__(self, raw_buff):
        self.reset()

        self.buff = bytecode.BuffHandle(raw_buff)

        self.buff.read(4)
        self.buff.read(4)

        self.sb = StringBlock(self.buff)

        self.m_resourceIDs = []
        self.m_prefixuri = {}
        self.m_uriprefix = {}
        self.m_prefixuriL = []
github androguard / androguard / core / bytecodes / jvm.py View on Github external
def create_method_ref(self, new_class_index, new_name_and_type_index) :
        new_mr_index = self.get_method_ref_index( new_class_index, new_name_and_type_index )
        if new_mr_index == -1 :
            new_mr = CreateMethodRef( self, new_class_index, new_name_and_type_index )
            self.add_constant_pool( MethodRef( self, bytecode.BuffHandle( new_mr.get_raw() ) ) )
            new_mr_index = self.get_constant_pool_count() - 1
        return new_mr_index
github honeynet / droidbot / droidbox_scripts / utils.py View on Github external
def __init__(self, raw_buff) :
        self.reset()

        self.buff = bytecode.BuffHandle( raw_buff )

        self.buff.read(4)
        self.buff.read(4)

        self.sb = StringBlock( self.buff )

        self.m_resourceIDs = []
        self.m_prefixuri = {}
        self.m_uriprefix = {}
        self.m_prefixuriL = []