-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassembly.py
40 lines (28 loc) · 924 Bytes
/
assembly.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import angr
import capstone
class Assembly:
def __init__(self,isa_type):
self.isa = isa_type
def isaType(self):
return self.isa.isaType()
def getCallTgt(self, insn):
target_address = None
if self.isa.isCall(insn):
if insn.operands:
for operand in insn.operands:
target_address = operand.imm
return target_address
def saveGPR(self):
return self.isa.pushGPR()
def restoreGPR(self):
return self.isa.popGPR()
def call(self, tgt_sym):
return self.isa.call(tgt_sym)
def jump(self, tgt_sym):
return self.isa.jump(tgt_sym)
def byte(self, val):
return self.isa.byte(val)
def callArgConst(self, const, argnum):
return self.isa.callArgConst(const, argnum)
def callArgLabel(self, label, argnum):
return self.isa.callArgLabel(label, argnum)