The changes in the registers and flags in the c functions

Started by Bora, December 30, 2007, 12:01:30 PM

Previous topic - Next topic

Bora

Some functions change some registers , flags . Is there any list about this. Maybe you will say the implementations change from compiler to compiler , so i need the list of msvcrt.dll if there is one.

Vortex

Hello Bora,

Calls to API functions are preserving the value of ebx,esi,edi,ebp. If you create your own callback functions, don't forget to preserve the value of those registers. The other registers for general purpose usage eax,ecx and edx can be modified by API functions or user-defined functions. The value of esp should be observed after a call to a C function like wsprintf. ( Normally, invoke takes care of stack balancing. )

To get the list of exported functions by msvcrt.dll :

\masm32\bin\dumpbin /EXPORTS C:\windows\system32\msvcrt.dll

For more information about register preservation :

http://win32assembly.online.fr/tut1.html