Skip to content

Instantly share code, notes, and snippets.

@lj1nu
Created January 30, 2019 15:20
Show Gist options
  • Save lj1nu/4b7bff1f147801d4e1811c9c84d431cd to your computer and use it in GitHub Desktop.
Save lj1nu/4b7bff1f147801d4e1811c9c84d431cd to your computer and use it in GitHub Desktop.
def get_basic_block(addr):
res = None
_func = idaapi.get_func(addr)
for block in idaapi.FlowChart(_func):
if block.startEA >= addr:
return hex(res)[:-1]
else:
res = block.startEA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment