Skip to content

Instantly share code, notes, and snippets.

@tmr232
Created December 2, 2016 11:17
Show Gist options
  • Save tmr232/1bd64fbbbc07f2a7634bcb9275929dac to your computer and use it in GitHub Desktop.
Save tmr232/1bd64fbbbc07f2a7634bcb9275929dac to your computer and use it in GitHub Desktop.
Delete functions with multiple chunks in IDA
import idaapi
import idautils
def iter_all_funcs():
for func_ea in idautils.Functions(idaapi.cvar.inf.minEA, idaapi.cvar.inf.maxEA):
yield idaapi.get_func(func_ea)
def iter_multichunk_funcs():
for func_t in iter_all_funcs():
if func_t.tailqty > 0:
yield func_t
def delete_multichunk_funcs():
for func_t in iter_multichunk_funcs():
idaapi.del_func(func_t.startEA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment