Skip to content

Instantly share code, notes, and snippets.

@nevermoe
Last active May 17, 2019 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevermoe/6dc5cd180ff11ceae5b8cb1c6c617d2b to your computer and use it in GitHub Desktop.
Save nevermoe/6dc5cd180ff11ceae5b8cb1c6c617d2b to your computer and use it in GitHub Desktop.
### a script
from idaapi import *
idaapi.step_over()
GetDebuggerEvent(WFNE_SUSP, -1)
rv = idaapi.regval_t()
idaapi.get_reg_val('EIP',rv)
ea = rv.ival
print "0x%x" % ea
from idaapi import *
### a while script
seg_name = "unknown"
while seg_name != "__text":
idaapi.step_over()
GetDebuggerEvent(WFNE_SUSP, -1)
rv = idaapi.regval_t()
idaapi.get_reg_val('PC',rv)
ea = rv.ival
print "0x%x" % ea
seg_name = idc.SegName(ea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment