So basically I my nasm syntax asm code, I use some extern functions like this:
extern _printf extern __imp__Sleep@4 .... call _printf call [__imp__Sleep@4]
Then I use nasm to assemble it into obj:
nasm -f win32 test.asm
Then I use IDA Pro to disassemble test.obj, I can see code like this:
See, extern function name like _printf has been kept.
But when I link this obj file:
cl /MT z:\\windows\\test.obj /link kernel32.lib libcmt.lib /SUBSYSTEM:CONSOLE
Then I use IDA Pro to disassemble test.exe, I can see code like this:
See, the function name of _printf has been changed.
I know basically after static link, the code of _printf has been put into the test.exe, in the subroutine of sub_409C9B
But basically I have to make the name of extern declared functions unchangeable, because I need to reverse engineering the test.exe and do some modify/remove towards those functions, and once PE exe lost the name info, I can not locate those targeting functions.
So my question is:
Why cl.exe will change the name of those functions, and is there any way to stop the change(I mean keep the function name unchangeable during the link time)?