Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2003, 12:33
gorge
 
Posts: n/a
commandline

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


.data?
lpCommandLine dd ?


call ProcessCmdLine
mov esi,[argv+04h]
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 [esi], 22h
sete cl
lea edx, [edx+ecx*2]
add eax, ecx
stosd
@@cm00: inc esi
cmp byte ptr [esi], 0
je @@cm01
cmp byte ptr [esi], dl
jne @@cm00
mov byte ptr [esi], 0
add esi, ecx
inc esi
cmp byte ptr [esi], 0
je @@cm01
inc [argc]
jmp @@cmss
@@cm01: pop ebx
pop esi
pop edi
inc [argc]
ret
ProcessCmdLine endp
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 21:22.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )