Reputation: 199
I am a newbie to intel-pin,I am trying to do a bit width analysis on binaries.
I try to analyze the exact number of bits used for operands in each assembly instruction.
For example if an unsigned integer 15 has been stored then 4 bits enough.
To do this I need to get a copy of the operands. Is there any method to do this using intel-pin api.
Upvotes: 3
Views: 1059
Reputation: 1718
Regarding memory operands, you can use INS_IsMemoryRead and INS_IsMemoryWrite to see if the instruction accesses memory, and then instrument it based on the number of memory operands (there can be more than one because some instructions implicitly access memory). Look at IARG_MEMORYREAD_EA and friends to get the memory read and write values in the analysis function.
To see the values in the actual registers you can use IARG_REG_VALUE.
Upvotes: 3