If you are doing something non-trivial in IDAPython, or if you added something to the C++ SDK which will then be reflected in IDAPython, an immensely useful rule-of-thumb is to perform a diff of the autogenerated SWiG wrappers.
Typically:
cp -R obj/x64_linux_gcc_32/3/wrappers/ /tmp/wrappers-before
<recompile...>
git diff /tmp/wrappers-before/ obj/x64_linux_gcc_32/3/wrappers/
It is always useful to make sure that SWiG did the right thing -- especially when modifying typemaps, but not only.
We use the "zzz" placeholder for a module name in this "how-to".
- create file swig/zzz.i
%{
#include <zzz.hpp>
%}
%include "zzz.hpp"
-
add zzz to the
MODULES_NAMES
var in makefile -
add zzz to
SDK_FILES
var in etc/sdk/sdk_files.mak -
add a line to python/idc.py if you want to autoload this module
import ida_zzz
-
build
-
update the content of api_contents.txt (from obj/.../api_contents.txt.new)
-
rebuild
-
update the content of pydoc_injections.txt (from obj/.../pydoc_injections.txt)