Author: David Zimmer
Date: 03.06.13 - 11:58pm
A while back I was trying to figure out an easier way to streamline my IDA plug-in development. I write a lot of plug-ins for a lot of different applications but I am not fan of the traditional plug-in development cycle at all.
I started experimenting with an IDA server plug-in that was just a server listening within IDA using some form of IPC mechanism. Initially I used sockets, as can be found in the IdaVBScript plugin. They are nice for some things such as having an instance of Olly in a remote virtual machine, sync the disassembly view in IDA on your desktop as you single step or hit breakpoints. However for wiring it to a scripting implementation, sockets add more overhead than necessary to handle synchronous requests, packet loss, timeouts etc.
The next step was to write a small C stub plugin that uses WM_CopyDATA window messaging as the IPC mechanism (IDASrvr). This automatically handles blocking and ensures synchronous requests. I then grabbed the Scintilla control I use in stream dumper and wired that with an IPC client and script control to create the IDA_Jscript poc. Currently it supports 34 IDA commands which is enough to be useful.
Being able to quickly code out of process plug-ins and having a full IDE with intellisense for your IDA scripting would be a really powerful capability. I wish I had time to fully build it out because its a great idea. Someone with more time and less tendinitis should really run with it, it would be a strong contender for the yearly plug-in contest. If my arms werent bothering me so much I would go for it, but its just not going to happen.
One other nice thing about this approach is that its easy to interface with it from just about any programming language. If you can call SendWindowMessage and CopyMemory you can interact with it. Examples are already available in C, C#, and vb6.
Source for all the projects mentioned above can be found in my RE_Plugins github repository
Update: See the project update that now includes built in debugger support.