Skip to content

Instantly share code, notes, and snippets.

@alexander-hanel
Created September 3, 2020 17:21
Show Gist options
  • Save alexander-hanel/46049ddfed42d8660f8be9a854928f89 to your computer and use it in GitHub Desktop.
Save alexander-hanel/46049ddfed42d8660f8be9a854928f89 to your computer and use it in GitHub Desktop.
get offset from hexrays output
ea = idaapi.get_screen_ea()
cfunc = idaapi.decompile(ea)
for cc, item in enumerate(cfunc.treeitems):
if item.ea != BADADDR:
if cfunc.treeitems.at(cc).ea == here():
print(cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment