Are there any good resources for developing debugger plugins in IDA Pro using the SDK that describe the IDA debugger API? An example of this is the IDA Pro ARM debugger plugin on Sourceforge. There seem to be few projects that have accomplished this. Specifically, how do you make a plugin in IDA which registers itself as one of the available debuggers and allows stepping through the IDA database while controlling a target?
None of the answers so far answer the actual question so here goes. A debugger plugin differs from a "normal" one in two points:
For examples, see |
||||
|
You can look for manual of IDA Plug-in in C/C++ here. Also You may watch a talk of IDA-Pro Creator Ilfak Guilfanov on Recon 2008 "BUILDING PLUGINS FOR IDA PRO" at SecurityTube And there is also IDAPython to create small automations too. |
|||||||
|
The debughook.py example script from the idapython suite illustrates all debug events that can be processed by a debugger plugin. Example scriptHere's a very simple script that colorizes all instructions as you trace them with the debugger.
Some notesIf you read from process memory in one of your debugger callbacks, you need to call refresh_debugger_memory() first (see file comment for RefreshDebuggerMemory() in idc.py). If you can, avoid that call since it is somewhat expensive. You can easily access all register via the cpu instance from the idautils package:
To read the current value from the top of the stack, use something like
|
||||
|
The IDA Pro Book 2nd edition from Chris Eagle has a little info in chapter 24 on interacting with the debugger through IDC and the SDK, but is more automation focused. Other than that maybe reading the source of other plugins that are doing this such as the ARM debugger plugin referenced in the question and digging through dbg.hpp in the SDK to see what it exposes. It also appears the source for IDA's debugger plugins is available in plugins/debugger in the SDK. I haven't seen writing a debugger plugin specifically documented. |
|||
|