vortex, the console startup code didn't check for 'tab'.. it failed to read correct argv[] when running the program with batch file that exist tab as commandline separator.
i make fixup like this:
; POASM
.586
.model flat,c
option casemap:none
WINBASEAPI_GetCommandLineA typedef proto stdcall
externdef stdcall _imp__GetCommandLineA@0: ptr WINBASEAPI_GetCommandLineA
GetCommandLine equ <_imp__GetCommandLineA@0>
WINBASEAPI_ExitProcess typedef proto stdcall :DWORD
externdef stdcall _imp__ExitProcess@4: ptr WINBASEAPI_ExitProcess
ExitProcess equ <_imp__ExitProcess@4>
main proto c :DWORD,:VARARG
.data?
_p__args db 144 dup(?) ; 32 for argv[x8], 128 for buffer
.code
_setargv proc uses esi edi
invoke GetCommandLine
mov esi,eax
mov edx,offset _p__args
push edx
lea edi,[edx+32]
xor ecx,ecx
mov ah,32
@@:
lodsb
test al,al
jz @5
cmp al,9
jz @b
cmp al,ah
jz @b
@0:
mov [edx],edi
add edx,4
inc ecx
jmp @2
@1:
lodsb
cmp al,ah
jz @3
cmp al,9
jz @3
@2:
cmp al,34
jnz @4
xor ah,32
jmp @1
@3:
mov al,0
@4:
stosb
test al,al
jnz @1
dec esi
jmp @b
@5:
mov eax,ecx ; argc
pop ecx ; argv[1]
ret
_setargv endp
public mainCRTStartup
mainCRTStartup proc
push ebp
mov ebp,esp
invoke _setargv
invoke main,eax,ecx ; argc,argv
invoke ExitProcess,eax
mainCRTStartup endp
end