IDAPython is an IDA plugin which makes it possible to write scripts for IDA in the Python programming language. IDAPython provides full access to both the IDA API and any installed Python module.
Check the scripts in the examples directory to get an quick glimpse.
Latest stable versions of IDAPython are available from https://awesomeopensource.com/project/idapython/src
The full function cross-reference is readable online at http://www.hex-rays.com/idapro/idapython_docs/
Mailing list for the project is hosted by Google Groups at http://groups.google.com/group/idapython
Start IDA with the following command line options:
-A -OIDAPython:yourscript.py file_to_work_on
-S"yourscript.py arg1 arg2 arg3"
(Please see http://www.hexblog.com/?p=128)
If you want fully unattended execution mode, make sure your script
exits with a
By default scripts run after the database is opened. Extended option format is:
Where N can be: 0: run script after opening database (default) 1: run script when UI is ready 2: run script immediately on plugin load (shortly after IDA starts and before processor modules and loaders)
You can place your custom settings to a file called 'idapythonrc.py' that should be placed to
The user init file is read and executed at the end of the init process.
Please note that IDAPython can be configured with "python.cfg" file.
The IDAPython plugin exposes a new IDC function
RunPythonStatement(string idc_code) that allows execution
of Python code from IDC
It is possible to use the
idc.eval() to evaluate IDC expressions from Python
By default, IDA will use IDC to evaluate expressions. It is possible to change the default language to use Python instead of IDC.
In order to do that, please use the following IDC code:
To disable Python language and revert back to IDC: