I am having difficulties trying to catch this bug.
when I use OllyDbg the GUI is loaded, but when I doubleclick the exe the GUI does not load.

invoke ProcessCmdLine
.if eax == 0 ; no arguments
; load gui
; execute functions without gui
invoke ExitProcess

ProcessCmdLine proc
invoke GetCommandLine
cmp byte ptr [eax], '"'
; ...
; eax points to argument
xor eax, eax ; no arguments
ProcessCmdLine endp

Posted on 2004-06-30 03:27:30 by Rammstein
shouldnt you be passing a parameter to ExitProcess?
Posted on 2004-06-30 04:56:03 by smurf
that's unnecessary

your most likely problem is incorrect PE subsystem flag
set it to GUI, and AllocConsole if you are not using one
Posted on 2004-06-30 08:17:29 by comrade
IMO OllyDbg's way of passing parameters isn't exactly like it is in a real situation. I don't remember the exact difference right now but I think it had to do with double quotes and the exe's filename. You could try making a test program that prints out the exact contents of the commandline string, and see what happens...
Posted on 2004-06-30 14:50:26 by QvasiModo
I have found and fixed the error.
Somehow OllyDbg was displaying eax = 0 after calling "invoke ProcessCmdLine", but without OllyDbg, eax wasn?t = 0.
I used vsprintf() to display the value of eax.

Posted on 2004-07-02 19:17:33 by Rammstein