IDAPython: namespacing for plugins, loaders & processor modules.
IDAPython plugins, loaders or processor modules developers.
IDAPython would load all loaders, processor modules & plugins in the
This causes namespace pollution, which can sometimes leads to very obscure errors.
Starting with version
7.1, IDA will import plugins, loaders & processor modules in their own, separate Python modules.
The names of those Python modules is derived from the plugin, loader or processor module’s file name.
- a plugin named
myplg.pywill now be imported into its own
- a loader named
myldr.pywill now be imported into its own
- a processor module named
myprc.pywill now be imported into its own
My plugin/loader/processor module complains about unexisting variables/functions!
It very likely means that the code in question was, in effect, relying on some other code being loaded before it, and that was “polluting” the
'__main__' module in a way that was very fortunate from its point-of-view (a happy coincidence, if you will.)
The solution is of course to fix the code in question so that it imports everything it needs, before making use of it.
I’m in a hurry
As a temporary workaround, you can set
This will cause IDA to revert to the old behavior, where the
'__main__' module is shared across all plugins, loaders, processor modules & user scripts.
However, please note that support for
NAMESPACE_AWARE will be removed sometimes in the future.