Using Wing with IDA Python

Index of All Documentation » How-Tos » How-Tos for Other Frameworks and Tools »

Wing is a Python IDE that can be used to develop, test, and debug Python code written for Hex-Rays IDA multi-processor disassembler and debugger. Two versions of Wing are appropriate for use with this document: Wing Pro is the full-featured Python IDE for professional programmers, and Wing Personal is a free alternative with reduced feature set.

If you do not already have Wing installed, download it now.

This document describes how to configure Wing for IDA. To get started using Wing as your Python IDE, please refer to the tutorial in Wing's Help menu or read the Quickstart Guide.

Debugging IDA Python in Wing

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 out of your Wing installation and may need to set WINGHOME inside to the location where Wing 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'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.

At that point, any breakpoints set in Python code should be reached and Wing 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 provides many other options and tools. For more information: