Porting guide for IDA 7.4 turning off IDA 6.x API backwards-compatibility by default
Intended audience: IDAPython developers
The problem
IDA 7.4 turns off IDA 6.x API backwards-compatibility by default.
Although there is a trivial way of turning 6.x backwards-compatibility back on, this should be considered a temporary measure, until the code is ported to the newer APIs (that have started shipping with IDA 7.0, back in 2017.)
Supporting IDA 7.x
Note that the new APIs have been baked in IDAPython since IDA 7.0, meaning that by porting existing IDAPython code according to this guide, you will not just support IDA 7.4: the ported code will also work in IDA 7.3, 7.2, 7.1 and 7.0.
This is a complementary guide
A general-purpose porting guide shipped at the time, which covers a great deal of the changes and is enough to port C/C++ code.
Alas, we now see that it is insufficient when it comes to accompanying developers in the task of porting their IDAPython code to the newer APIs, simply because IDAPython has some specific concepts & constructs, that require special attention.
That being said, this very guide should be considered as a complement to the original guide, and not as a replacement.
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.
The following types have been moved/renamed:
ida_kernwin.Choose2
ida_kernwin.Choose
ida_ua.insn_t.Operands
ida_ua.insn_t.ops
ida_kernwin.Choose2.OnSelectLine
ida_kernwin.Choose.OnSelectLine
if the chooser is CH_MULTI
, will receive (and must return) a list of selected indices, instead of just 1 index
ida_kernwin.Choose2.OnDeleteLine