-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSearchForAddress.py
More file actions
41 lines (24 loc) · 840 Bytes
/
Copy pathSearchForAddress.py
File metadata and controls
41 lines (24 loc) · 840 Bytes
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
41
#!/usr/bin/env python
import immlib
DESC = "find Instructions!"
def main(args) :
imm = immlib.Debugger()
assembledInstruction = imm.assemble(' '.join(args))
if not assembledInsctruction:
return "[*] No Insctruction Given!"
addressList = imm.search(assembledInstruction)
td = imm.createTable("Instruction Locations", ['Module', 'Base Address', 'Instruction Address', 'Instruction'])
for address in addressList:
module = imm.findModule(address)
if not module:
imm.log("Address: 0x%08X not in any module"%address)
continue
instruction = ''
numArgs = len(' '.join(args).split('\n'))
for count in range(0, numArgs) :
instruction += imm.disasmForward(address, nlines=count).getDisasm() + ' '
td.add(0, [ module[0],
str('0x%08X'%module[1],
str('0x%08X'%address),
instruction
])