Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import idautils
- from idaapi import *
- import re
- sc = idautils.Strings()
- packets = {}
- for s in sc:
- value = str(s)
- if re.match("eTr[a-zA-Z0-9]+Ack", value):
- xrefs = idautils.XrefsTo(s.ea)
- for xref in xrefs:
- opcode = GetMnem(xref.frm)
- if opcode == 'lea':
- opcod2 = GetMnem(xref.frm-0x4C)
- if opcod2 == 'mov':
- packets[value.replace('eTr', '')] = hex(GetOperandValue(xref.frm-0x4C, 1)).replace('L', '')
- with open('G:\\packets.txt', 'wb') as f:
- for opcode in packets:
- f.write(opcode + '=' + packets[opcode] + '\n')
Add Comment
Please, Sign In to add comment