I am currently using this code to parse the commandline which I found on this board.
But When I display the commandline i get garbage characters. What am I doing wrong?

lpCommandLine dd ?

call ProcessCmdLine
mov esi,
mov lpCommandLine,esi

ProcessCmdLine proc
push edi
push esi
push ebx
call GetCommandLine
mov esi, eax
mov edi, OFFSET argv
xor ecx, ecx
xor ebx, ebx
xor edx, edx
@@cmss: mov eax, esi
mov dl, 20h
cmp byte ptr , 22h
sete cl
lea edx,
add eax, ecx
@@cm00: inc esi
cmp byte ptr , 0
je @@cm01
cmp byte ptr , dl
jne @@cm00
mov byte ptr , 0
add esi, ecx
inc esi
cmp byte ptr , 0
je @@cm01
jmp @@cmss
@@cm01: pop ebx
pop esi
pop edi
ProcessCmdLine endp
Posted on 2003-05-19 18:59:10 by gorge
Your source code is missing some important elements.
Where are defined the argc and argv variables?
Posted on 2003-05-20 01:29:53 by Vortex
argc dd ?
argv dd 16 dup (?)

here is the declaration.
Posted on 2003-05-20 10:17:33 by gorge