Another new feature that will be available in the upcoming version of IDA Pro is the ability to create and render custom data types and formats.
(Embedded instructions disassembled and rendered along side with x86 code)
For example, here is a custom MAKE_DWORD format applied to the built-in dword type:
Its implementation is very simple:
Next we illustrate some possible usages of custom types and formats. Other uses are also possible too, it is up to your imagination.
Imagine you are debugging an x86 program that implements its own VM and embeddes them in the program.
The classical solution for this problem can be:
With this new addition, one can just write a custom data type to handle the situation:
And if you happen to have a situation where the bytecodes are operands to instructions (as means of obfuscation), you can still apply the custom format on those operands:
The previous blog entry showed how to write processor modules using Python. What if one simply uses the “import” statement to import a full-blown processor module script and use it in the custom data types/formats? 😉
When reversing MS Windows applications, one can encounter string IDs, but then how to easily and nicely go fetch the data and display it in the disassembly listing?
Normally, one would have to use a resource editor to extract the string value corresponding to the string id, then to create an enum in IDA for each string ID with a repeatable comment:
That works, but what about writing your own custom format instead:
And then applying it directly without having to use a resource editor to extract the string value, have the custom format do that programmatically for you :
This is how a resource string custom format handler can look like:
To take a closer look at it, you can download the custom data type handler script along with the source code of the simplevm assembler/disassembler and the C program that was used in this article.