I have a 64-bit COFF object file (no source code or debug info) from which I need to extract a single procedure.
The procedure is relatively short, and its only dependencies are:
- One global variable.
- A couple of imported procedure.
I have already tried disassembling and re-assembling the code; however, for some odd reason, even though the code looks the same in a debugger and a disassembler, it doesn't behave the same way. (I've already tried making sure that the executable sections have the correct flags, etc. but to my knowledge, all of these are correct, and the values also match what they "should" be at runtime.)
So is there any way to directly copy over the function to a new object file (or to delete everything except that function), without having to disassembling and reassemble the code in the process?