Beispiel #1
0
 def disassemble(self, address=None, nb_instr=10):
     before = 0
     # FIXME: Write better heuristic to read less bytes
     after = nb_instr * MAX_INSTR_SIZE
     if address is None:
         address = self.getInstrPointer()
     address += before
     code = self.readBytes(address, before + 1 + after)
     for index, instr in enumerate(disassemble(code, address)):
         yield instr
         if nb_instr and nb_instr <= (index + 1):
             break
Beispiel #2
0
 def disassemble(self, address=None, nb_instr=10):
     before = 0
     # FIXME: Write better heuristic to read less bytes
     after = nb_instr * MAX_INSTR_SIZE
     if address is None:
         address = self.getInstrPointer()
     address += before
     code = self.readBytes(address, before+1+after)
     for index, instr in enumerate(disassemble(code, address)):
         yield instr
         if nb_instr and nb_instr <= (index+1):
             break
Beispiel #3
0
    def disassemble(self, start=None, stop=None, nb_instr=None):
        if not HAS_DISASSEMBLER:
            self.notImplementedError()
        if start is None:
            start = self.getInstrPointer()
        if stop is not None:
            stop = max(start, stop)
            size = stop - start + 1
        else:
            if nb_instr is None:
                nb_instr = DEFAULT_NB_INSTR
            size = nb_instr * MAX_INSTR_SIZE

        code = self.readBytes(start, size)
        for index, instr in enumerate(disassemble(code, start)):
            yield instr
            if nb_instr and nb_instr <= (index + 1):
                break
Beispiel #4
0
    def disassemble(self, start=None, stop=None, nb_instr=None):
        if not HAS_DISASSEMBLER:
            self.notImplementedError()
        if start is None:
            start = self.getInstrPointer()
        if stop is not None:
            stop = max(start, stop)
            size = stop - start + 1
        else:
            if nb_instr is None:
                nb_instr = DEFAULT_NB_INSTR
            size = nb_instr * MAX_INSTR_SIZE

        code = self.readBytes(start, size)
        for index, instr in enumerate(disassemble(code, start)):
            yield instr
            if nb_instr and nb_instr <= (index + 1):
                break