How to use the bytecode._Print 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 show(self) :
        print "#" * 60
        bytecode._Print("\tSAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED", self.frame_type.get_value())
        bytecode._Print("\tOFFSET_DELTA", self.offset_delta.get_value())
        self.stack.show()
        print "#" * 60
github androguard / androguard / core / bytecodes / jvm.py View on Github external
nb = 0
        for i in self.fields :
            print nb,
            i.show()
            nb += 1


        bytecode._Print( "METHODS COUNT", self.methods_count.get_value() )
        nb = 0
        for i in self.methods :
            print nb,
            i.pretty_show(vm_a)
            nb += 1


        bytecode._Print( "ATTRIBUTES COUNT", self.attributes_count.get_value() )
        nb = 0
        for i in self.__attributes :
            print nb,
            i.show()
github androguard / androguard / core / bytecodes / jvm.py View on Github external
Show the .class format into a human readable format
        """
        bytecode._Print( "MAGIC", self.magic.get_value() )
        bytecode._Print( "MINOR VERSION", self.minor_version.get_value() )
        bytecode._Print( "MAJOR VERSION", self.major_version.get_value() )
        bytecode._Print( "CONSTANT POOL COUNT", self.constant_pool_count.get_value() )

        nb = 0
        for i in self.constant_pool :
            print nb,
            i.show()
            nb += 1


        bytecode._Print( "ACCESS FLAGS", self.access_flags.get_value() )
        bytecode._Print( "THIS CLASS", self.this_class.get_value() )
        bytecode._Print( "SUPER CLASS", self.super_class.get_value() )

        bytecode._Print( "INTERFACE COUNT", self.interfaces_count.get_value() )
        nb = 0
        for i in self.interfaces :
            print nb,
            print i

        bytecode._Print( "FIELDS COUNT", self.fields_count.get_value() )
        nb = 0
        for i in self.fields :
            print nb,
            i.show()
            nb += 1

github androguard / androguard / core / bytecodes / jvm.py View on Github external
def pretty_show(self, vm_a) :
        """
            Show the .class format into a human readable format
        """
        bytecode._Print( "MAGIC", self.magic.get_value() )
        bytecode._Print( "MINOR VERSION", self.minor_version.get_value() )
        bytecode._Print( "MAJOR VERSION", self.major_version.get_value() )
        bytecode._Print( "CONSTANT POOL COUNT", self.constant_pool_count.get_value() )

        nb = 0
        for i in self.constant_pool :
            print nb,
            i.show()
            nb += 1


        bytecode._Print( "ACCESS FLAGS", self.access_flags.get_value() )
        bytecode._Print( "THIS CLASS", self.this_class.get_value() )
        bytecode._Print( "SUPER CLASS", self.super_class.get_value() )

        bytecode._Print( "INTERFACE COUNT", self.interfaces_count.get_value() )
        nb = 0
        for i in self.interfaces :
            print nb,
github androguard / androguard / core / bytecodes / dvm.py View on Github external
def show(self) :
        bytecode._Print("HEADER", self.format)
github androguard / androguard / core / bytecodes / dvm.py View on Github external
def _begin_show(self) :
        print "*" * 80
        print "DALVIK_CODE :"
        bytecode._Print("\tREGISTERS_SIZE", self.registers_size)
        bytecode._Print("\tINS_SIZE", self.ins_size)
        bytecode._Print("\tOUTS_SIZE", self.outs_size)
        bytecode._Print("\tTRIES_SIZE", self.tries_size)
        bytecode._Print("\tDEBUG_INFO_OFF", self.debug_info_off)
        bytecode._Print("\tINSNS_SIZE", self.insns_size)

        #self.handlers.show()

        print ""
github androguard / androguard / core / bytecodes / jvm.py View on Github external
def show(self) :
        print "#" * 60
        bytecode._Print("\tFULL_FRAME", self.frame_type.get_value())
        bytecode._Print("\tOFFSET_DELTA", self.offset_delta.get_value())

        bytecode._Print("\tNUMBER_OF_LOCALS", self.number_of_locals.get_value())
        for i in self.__locals :
            i.show()

        bytecode._Print("\tNUMBER_OF_STACK_ITEMS", self.number_of_stack_items.get_value())
        for i in self.__stack :
            i.show()

        print "#" * 60
github androguard / androguard / core / bytecodes / dvm.py View on Github external
def pretty_show(self, vm_a) :
        bytecode._Print( "MAP_ITEM", self.format )
        bytecode._Print( "\tTYPE_ITEM", TYPE_MAP_ITEM[ self.format.get_value().type ])

        if self.item != None :
            if isinstance( self.item, list ):
                for i in self.item :
                    if isinstance(i, ClassDataItem) :
                        i.pretty_show(vm_a)
                    elif isinstance(self.item, CodeItem) == False :
                        i.show()
            else :
                if isinstance(self.item, ClassDataItem) :
                    self.item.pretty_show(vm_a)
                elif isinstance(self.item, CodeItem) == False :
                    self.item.show()
github androguard / androguard / core / bytecodes / dvm.py View on Github external
def show(self) :
        bytecode._Print("MAP_LIST SIZE", self.size.get_value())
        for i in self.map_item :
            i.show()