Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from idaapi import *
- from idc import *
- class MyDbgHook(DBG_Hooks):
- file_count = 0
- def dbg_bpt(self, tid, ea):
- if ea == 0x0040FAC9:
- esp = GetRegValue('esp')
- addr = Dword(esp + 4)
- size = Dword(esp + 8)
- data = DbgRead(addr, size)
- f = open('%d.lua' % self.file_count, 'w')
- f.write(data)
- f.close()
- self.file_count += 1
- request_continue_process()
- run_requests()
- return 0
- hook
- try:
- if debughook:
- print("Removing previous hook ...")
- debughook.unhook()
- except:
- pass
- debughook = MyDbgHook()
- debughook.hook()
- debughook.steps = 0
- ea = 0x0040FAC9
- request_run_to(ea)
- AddBpt(ea)
- run_requests()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement