Using Wing with IDA Python
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.
To get started using Wing, refer to the tutorial in the Help menu in Wing or 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 wingdbstub.Ensure()
You will need to copy wingdbstub.py out of your Wing installation and may need to set WINGHOME inside wingdbstub.py 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.
Wing provides many other options and tools. For more information: