ob-idapython
brings the ability to interact with IDA Pro directly from Emacs using Org Babel. Inspired by idacode for VSCode.
With ob-idapython
, you can execute Python code in IDA Pro from within your Org files. This is particularly useful for reverse engineering tasks, scripting, and automating workflows in IDA while maintaining all the benefits of Org mode in Emacs.
This package provides:
- A simple interface to send Python code to an IDA Pro instance.
- Integration with Org Babel for reproducible workflows.
- Support for custom configurations to match your development setup.
To use ob-idapython
, ensure you have the following:
- IDA Pro installed.
- Python 3 configured with IDA.
- Emacs with Org mode installed.
- The plugin file
ida_babel.py
installed in IDA’s plugin directory.
First, start the IDA Babel Server.
Then, execute an idapython
source block, and the results will be in the IDA console.
#+BEGIN_SRC idapython :host localhost :port 4000 import idc func_name = idc.get_func_name(idc.here()) print(f"Current function: {func_name}") #+END_SRC
Place the ob-idapython
directory in your Emacs load path, then add the following configuration to your Emacs init file:
(use-package ob-idapython
:load-path "/path/to/ob-idapython/"
:after org
:config
(progn
(add-to-list 'org-babel-load-languages '(idapython . t))
(add-to-list 'org-src-lang-modes '("idapython" . python))
(require 'ob-idapython)))
Copy the ida_babel.py
script to your IDA plugins directory.
IDA_USER_DIR="~/.idapro/"
ln -sf $(pwd)/ida_babel.py $IDA_USER_DIR/plugins/ida_babel.py
This will create a symbolic link to the plugin file in your IDA Pro user directory.
Open IDA Pro and navigate to File -> Plugins -> IDA Babel Server
. Start the server from the menu.