Home » Support » Index of All Documentation » How-Tos » How-Tos for Other Libraries »

Using Wing IDE with IDA Python

Wing IDE is an integrated development environment that can be used to write, test, and debug Python code that is written for Hex-Rays IDA multi-processor disassembler and debugger. Wing provides auto-completion, call tips, a powerful debugger, and many other features that help you write, navigate, and understand Python code.

For more information on Wing IDE see the product overview. If you do not already have Wing IDE installed, download a free trial now.

To get started using Wing, refer to the tutorial in the Help menu in Wing and/or the Wing IDE Quickstart Guide.

Debugging IDA Python in Wing IDE

IDA embeds a Python interpreter that can be used to script the system. In order to debug Python code that is run within IDA, you need to import a special module in your code, as follows:

import wingdbstub

You will need to copy wingdbstub.py out of your Wing IDE installation and may need to set WINGHOME inside wingdbstub.py to the location where Wing IDE is installed (on OS X, the name of Wing's .app folder) if this value is not already set. Even though this is an embedded instance of Python, leave the kEmbedded flag set to 0.

Next click on the bug icon in the lower left of Wing IDE's main window and make sure that Accept Debug Connections is checked. Then restart IDA and the debug connection should be made as soon as the above code is executed, as indicated by the color of the bug icon in Wing IDE.

At that point, any breakpoints set in Python code should be reached and Wing IDE can be used to inspect the runtime state, step through code, and try out new code in the live runtime.

For details see Debugging Externally Launched Code.

Related Documents

Wing IDE provides many other options and tools. For more information:

Using Wing IDE with IDA Python