;----------------------------------------------------------------------------------------------------
00406738 CCCCCCCCCCCCCCCC Align 16
00406740 SUB_L00406740: ;PARSE COMMAND LINE PARAMETERS
00406740 55 push ebp
00406741 8BEC mov ebp,esp
00406743 83EC14 sub esp,00000014h
00406746 8B4518 mov eax,[ebp+18h] ;argc count. [ebp+18h] is pointer to a counter
00406749 C70000000000 mov dword ptr [eax],00000000h ;start argc counter = 0
0040674F 8B4D14 mov ecx,[ebp+14h]
00406752 C70101000000 mov dword ptr [ecx],00000001h ;start +14h counter = 1
00406758 8B5508 mov edx,[ebp+08h] ;pointer to command line
0040675B 8955FC mov [ebp-04h],edx ;local storage for pointer into command line
0040675E 837D0C00 cmp dword ptr [ebp+0Ch],00000000h ;[ebp+0Ch] is pointer into argv[] array of pointers
00406762 7411 +--jz L00406775
00406764 8B450C | mov eax,[ebp+0Ch] ;[ebp+0Ch] is pointer into argv[] array of pointers
00406767 8B4D10 | mov ecx,[ebp+10h] ;[ebp+10h] is pointer into current parameter we are building/read back
0040676A 8908 | mov [eax],ecx
0040676C 8B550C | mov edx,[ebp+0Ch] ;pointer into argv[] array of pointers
0040676F 83C204 | add edx,00000004h
00406772 89550C v mov [ebp+0Ch],edx
00406775 L00406775:
00406775 8B45FC mov eax,[ebp-04h] ;[ebp-04h] is pointer into command line.
00406778 0FBE08 movsx ecx,[eax]
0040677B 83F922 cmp ecx,00000022h ; "
0040677E 0F85C9000000 +<------jnz L0040684D ;jump if we don't have a "
00406775 8B45FC mov eax,[ebp-04h] ;[ebp-04h] is pointer into command line.
00406778 0FBE08 movsx ecx,[eax]
0040677B 83F922 cmp ecx,00000022h ; "
0040677E 0F85C9000000 +<------jnz L0040684D ;jump if we don't have a "
|
| ;COMMAND LINE BEGINS WITH A "
| ;parse off the 0th parameter (program filename) enclosed in "". No special handling for backslashes?
00406784 | +------->L00406784:
00406784 8B55FC | ^ mov edx,[ebp-04h] ;[ebp-04h] is pointer into command line.
00406787 83C201 | | add edx,00000001h ;increment pointer into command line. Move to next character
0040678A 8955FC | | mov [ebp-04h],edx
0040678D 8B45FC | | mov eax,[ebp-04h] ;[ebp-04h] is pointer into command line.
00406790 0FBE08 | | movsx ecx,[eax] ;next character
00406793 83F922 | | cmp ecx,00000022h ; "
00406796 747A | | +<--jz L00406812 ;jump if we have a closing " (command line begins "", or "C:\test a\MyProgram.exe")