Ejemplo n.º 1
0
    def getJumpDestination(self, address, insn, args):
        #example:
        #address = 84L
        #insn = 'brge'
        #args = '.+6     '

        if insn in ['sbrc', 'sbrs']: #skip instructions
            #TODO XXX: this depends on the size of the instruction skipped!
            # (can be 16 or 32 bits (jmp, call, lds, sts))
            return long(address + 4)
        if args[0] == '.': #relative jump
            offset = long(args[1:])
            return long(address + offset + 2)
        else: #absolute jump?
            return Architecture.getJumpDestination(self, address, insn, args)
Ejemplo n.º 2
0
 def getJumpDestination(self, address, insn, args):
     r = args.split(",")
     if len(r) == 1:
         return Architecture.getJumpDestination(self, address, insn, args)
     return Architecture.getJumpDestination(self, address, insn, r[-1])
Ejemplo n.º 3
0
 def __init__(self):
     Architecture.__init__(self, ppc_jumps, ppc_calls)
Ejemplo n.º 4
0
 def getJumpDestination(self, address, insn, args):
     r = self.jumpRegexp.match(args)
     if r == None:
         return Architecture.getJumpDestination(self, address, insn, args)
     return Architecture.getJumpDestination(self, address, insn, r.group(2))
Ejemplo n.º 5
0
 def __init__(self):
     Architecture.__init__(self, mips_jumps, mips_calls)
     self.jumpRegexp = re.compile("(?:(" + REGISTER_REGEXP + "),)+" + "(" + ADDRESS_REGEXP + ")")
Ejemplo n.º 6
0
 def getJumpDestination(self, address, insn, args):
     r = args.split(",")
     if len(r) == 1:
         return Architecture.getJumpDestination(self, address, insn, args)
     return Architecture.getJumpDestination(self, address, insn, r[-1])
Ejemplo n.º 7
0
 def __init__(self):
     Architecture.__init__(self, ppc_jumps, ppc_calls)
Ejemplo n.º 8
0
 def getJumpDestination(self, address, insn, args):
     r = self.jumpRegexp.match(args)
     if r == None:
         return Architecture.getJumpDestination(self, address, insn, args)
     return Architecture.getJumpDestination(self, address, insn, r.group(2))
Ejemplo n.º 9
0
 def __init__(self):
     Architecture.__init__(self, mips_jumps, mips_calls)
     self.jumpRegexp = re.compile("(?:(" + REGISTER_REGEXP + "),)+" + "(" + ADDRESS_REGEXP + ")");