Created
February 16, 2026 00:37
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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