Log in

View Full Version : WinMain question


0rp
June 28th, 2004, 05:39
if i load a visual c++ gui app into olly, the stack points to the 4 winmain params (current instance, prev instance, cmdline, showstate), but if i load a delphi gui app, the stack points to some bogus values.

i thought, every gui app OEP gets called with the 4 winmain params pushed by the win32 loader?

lifewire
June 28th, 2004, 07:00
nope. WinMain is not the entrypoint of your C++ program. the entrypoint of your C++ program is inside some .lib that is always linked with your .exe. in that lib, information is gathered and passed to winmain. like a GetModuleHandle(NULL) to obtain the HINSTANCE and such. that is also why an emtpy (main {}) compiled .cpp file is so large.