InstructionCounter plugin for IDA Pro
sp <foobarcom> Friday, November 25 2005 16:04.03 CST


The InstructionCounter plugin for IDA Pro is actually the first plugin Ive ever succesfully finished. The main reason for this is probably that its not exactly a very complicated plugin but basically a copy / paste of the template code from Steve Micallefs awesome IDA plugin tutorial with just a few extra lines added.



The plugin counts all instructions used in a file, orders them by their frequency of occurrence and prints all that information to a text file of your choice.



Heres what the output looks like:



Opcode distribution of file: D:Coding
es
ewPage_15.idb
Total opcodes: 6390

0001. 001337    20.92%      LDA
0002. 001022    15.99%      STA
0003. 000589     9.22%      JSR
0004. 000260     4.07%      RTS
0005. 000205     3.21%      AND
0006. 000198     3.10%      LDX
0007. 000186     2.91%      CMP
0008. 000178     2.79%      ADC
0009. 000177     2.77%      BNE
0010. 000171     2.68%      BEQ
...



The ZIP file contains the complete Visual C++ source code and the compiled plugin for IDA 4.8 and IDA 4.9.



There are two minor problems Im having which are mentioned in the source file. Unfortunately none of the people I bug about my IDA problems have been online in the last few days.



Furthermore I was convinced that a plugin like that already exists but I didnt find anything at the IDA Palace when I needed it a few days ago. If theres really already a plugin like that let me know.

Comments
Posted: Wednesday, December 31 1969 18:00.00 CST