def __disassemble(self, addr, length): eSections = self.__binary.executableSections for section in eSections: if section.virtualAddress <= addr and section.virtualAddress + section.size > addr: ropper = Ropper(self.binary) code = bytes(bytearray(section.bytes)) g = ropper.disassemble(code, addr, addr - section.virtualAddress, length) if not g: self.__cprinter.printError('Cannot disassemble address: %s' % toHex(addr)) return if length < 0: length = length * -1 if len(g) < length: self.__cprinter.printInfo('Cannot disassemble specified count of instructions') self.binary.printer.printTableHeader('Instructions') self.__cprinter.println(g.disassemblyString()) return
def __disassemble(self, addr, length): eSections = self.__binary.executableSections for section in eSections: if section.virtualAddress <= addr and section.virtualAddress + section.size > addr: ropper = Ropper(self.binary) code = bytes(bytearray(section.bytes)) g = ropper.disassemble(code, addr, addr - section.virtualAddress, length) if not g: self.__cprinter.printError( 'Cannot disassemble address: %s' % toHex(addr)) return if length < 0: length = length * -1 if len(g) < length: self.__cprinter.printInfo( 'Cannot disassemble specified count of instructions') self.binary.printer.printTableHeader('Instructions') self.__cprinter.println(g.disassemblyString()) return