Porting guide for changes in IDAPython-on-Python-3 APIs
Intended audience: IDAPython developers
Scope of this guide
IDA 7.4 comes with the possibility of using Python 3.
Using Python 3 means that some code, which used to work, might require porting:
print()
becoming a function, not a statementxrange
becomingrange
__builtin__
becomingbuiltins
strings being unicode and not sets of bytes
integer division uses
//
and not/
map()
returning a map object, not a list{}.iteritems()
(and similar) are gonesome changes in the
import
mechanism…
Those are all well-documented Python 3 specifics, are thoroughly documented, and Python even provides tools to help with the transition.
This guide is not about those, but about IDAPython-specific changes to the API, but many of those being “ripples” of those Python 3 changes.
The guide
Note: that all qualified names below use their originating IDAPython module’s name (e.g., ida_kernwin
) instead of the ‘umbrella’ idaapi
module.
Last updated