示例#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)
示例#2
0
文件: ppc.py 项目: 13572293130/dissy
 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])
示例#3
0
文件: ppc.py 项目: 13572293130/dissy
 def __init__(self):
     Architecture.__init__(self, ppc_jumps, ppc_calls)
示例#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))
示例#5
0
 def __init__(self):
     Architecture.__init__(self, mips_jumps, mips_calls)
     self.jumpRegexp = re.compile("(?:(" + REGISTER_REGEXP + "),)+" + "(" + ADDRESS_REGEXP + ")")
示例#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])
示例#7
0
 def __init__(self):
     Architecture.__init__(self, ppc_jumps, ppc_calls)
示例#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))
示例#9
0
 def __init__(self):
     Architecture.__init__(self, mips_jumps, mips_calls)
     self.jumpRegexp = re.compile("(?:(" + REGISTER_REGEXP + "),)+" + "(" + ADDRESS_REGEXP + ")");