Should I go the plugin route? Or is that overkill? I downloaded the SDK + started reading this: http://www.binarypool.com/idapluginwriting/idapw.pdf
Edit: w00t scripts will work, thanks! I'm working on it now!
---------- Post added at 11:46 AM ---------- Previous post was at 10:23 AM ----------
Figured it out - now does anyone know how to search for floats w/in IDA? (w/o writing a script)
Here is the auto-conversion script:
Code:
#include <idc.idc>
static _ConvertSegmentToFloats(segStart, segEnd, size){
auto address, flags, result;
result = 0;
address = segStart;
while ( address < segEnd ){
flags = GetFlags(address);
// we have valid data here
if ( isData(flags) ){
// float
if ( size == 0x4 && !isFloat(flags) ){
result = OpFloat(address, 0);
Message("\n [%d] Converting location 0x%X to a float", result, address);
}
// double
else if ( size == 0x8 && !isDouble(flags) ){
result = OpFloat(address, 0);
Message("\n [%d] Converting location 0x%X to a double", result, address);
}
}
// increase by size!
address = address + size;
}
}
static main(){
auto segPointer;
auto segStart, segEnd, segName;
// Get the pointer to our first segment
segPointer = FirstSeg();
while (segPointer != BADADDR){
segName = SegName(segPointer);
segStart = SegStart(segPointer);
segEnd = SegEnd(segPointer);
//Message("\n%s from 0x%X to 0x%X", segName, segStart, segEnd );
// floats
if ( segName == "__literal4" ){
_ConvertSegmentToFloats(segStart, segEnd, 0x4);
}
// doubles
else if ( segName == "__literal8" ){
_ConvertSegmentToFloats(segStart, segEnd, 0x8);
}
segPointer = NextSeg( segPointer );
}
}