Skip to content

Instantly share code, notes, and snippets.

@daaximus
Created February 16, 2026 00:37
Show Gist options
  • Select an option

  • Save daaximus/ff8caa2e9a587b9cce055471c99cf7ed to your computer and use it in GitHub Desktop.

Select an option

Save daaximus/ff8caa2e9a587b9cce055471c99cf7ed to your computer and use it in GitHub Desktop.
IDA Pro 9.x Plugin to comment where an API is imported from
import idaapi
import idc
class import_lib_commenter(idaapi.plugin_t):
flags = 0
comment = "comment the import module for the __imp_ entries"
help = ""
wanted_name = "import_lib_commenter"
wanted_hotkey = "Shift+L"
def init(self):
return idaapi.PLUGIN_OK
def run(self, arg):
count = 0
for i in range(idaapi.get_import_module_qty()):
mod = 'IMPORTED FROM: ' + idaapi.get_import_module_name(i)
mod = ''.join(mod) + '.dll'
def cb(ea, name, ordinal, mod=mod):
idc.set_cmt(ea, mod, 1)
return True
idaapi.enum_import_names(i, cb)
count += 1
idaapi.refresh_idaview_anyway()
def term(self):
pass
def PLUGIN_ENTRY():
return import_lib_commenter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment