Skip to content

Instantly share code, notes, and snippets.

@alexander-hanel
Created May 9, 2019 17:29
Show Gist options
  • Save alexander-hanel/16fe450021ab44e5d8ba07cbae6c30d4 to your computer and use it in GitHub Desktop.
Save alexander-hanel/16fe450021ab44e5d8ba07cbae6c30d4 to your computer and use it in GitHub Desktop.
import idautils
comments = {}
for func in idautils.Functions():
flags = idc.get_func_attr(func, FUNCATTR_FLAGS) # skip library & thunk functions
if flags & FUNC_LIB or flags & FUNC_THUNK:
continue
dism_addr = list(idautils.FuncItems(func))
for ea in dism_addr:
temp = idc.get_cmt(ea, 0)
if temp:
comments[ea] = temp
temp = idc.get_cmt(ea, 1)
if temp:
comments[ea] = temp
print comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment