Function at 0x405960
Capabilities:
Accept command line arguments
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
xor esi, esi
push edi
or ebx, 0xffffffff
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], esi
call dword [sym.imp.KERNEL32.dll_GetVersion]
and eax, 0x80000000
neg eax
sbb eax, eax
and eax, 0xfff20000
add eax, 0xfc000
mov dword [0x41a93c], eax
call fcn.0040b170
test eax, eax
jge 0x4059ab
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
call fcn.00404f40
call dword [sym.imp.KERNEL32.dll_SetFileApisToOEM]
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov cl, byte [eax]
test cl, cl
je 0x4059d4
cmp cl, 0x20
je 0x4059d4
cmp cl, 9
je 0x4059d4
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4059c2
mov dl, byte [eax]
xor ecx, ecx
cmp dl, 9
mov dword [ebp - 0xc], esi
sete cl
mov dword [ebp - 8], ecx
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov edi, dword [ebp - 0x1c]
mov esi, eax
mov al, byte [esi]
test al, al
je 0x405ab1
cmp al, 0x7e
jne 0x405a0b
inc dword [ebp - 4]
jmp 0x405a9a
cmp al, 0x3d
jne 0x405a17
inc dword [ebp - 0xc]
jmp 0x405a9a
push 8
push esi
push str.MKSARGS
call fcn.0040b110
add esp, 0xc
test eax, eax
jne 0x405a69
push 0x10
lea edx, [esi + 8]
push eax
push edx
call fcn.0040afc0
add esp, 0xc
mov ebx, eax
push 0
push 0
push 0
push 0xf001f
push ebx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
test edi, edi
je 0x405a64
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp eax, dword [edi + 8]
jne 0x405a64
inc dword [ebp - 8]
jmp 0x405a9a
or ebx, 0xffffffff
jmp 0x405a9a
push 5
push esi
push str.PATH
call fcn.0040b110
add esp, 0xc
test eax, eax
jne 0x405a80
mov dword [ebp - 0x18], esi
push 5
push esi
push str.Path
call fcn.0040b110
add esp, 0xc
test eax, eax
jne 0x405a97
mov dword [ebp - 0x1c], esi
inc dword [ebp - 0x10]
push esi
call fcn.004084e0
lea esi, [esi + eax + 1]
add esp, 4
mov al, byte [esi]
test al, al
jne 0x4059ff
mov eax, dword [ebp - 0x18]
xor esi, esi
cmp eax, esi
jne 0x405ac1
mov eax, dword [ebp - 0x1c]
cmp eax, esi
je 0x405ac4
mov dword [ebp - 0x14], eax
cmp dword [ebp - 8], esi
jne 0x405ad1
mov dword [ebp - 4], esi
mov dword [ebp - 8], esi
jmp 0x405af1
cmp ebx, 0xffffffff
je 0x405e9e
mov esi, 2
mov dword [ebp - 8], esi
mov ebx, dword [sym.imp.KERNEL32.dll_SetErrorMode]
push 0
call ebx
or al, 2
push eax
call ebx
cmp esi, 2
jne 0x405afc
mov eax, dword [edi + 0x10]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
test eax, eax
je 0x405b2d
mov ecx, eax
lea edx, [ecx*4 + 4]
push edx
call fcn.00403f50
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [ebp - 0x1c], ebx
jne 0x405b30
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
jmp 0x405b30
mov ebx, dword [ebp - 0x1c]
cmp dword [ebp - 8], 2
jne 0x405b5e
mov esi, dword [ebp - 4]
add edi, 0x14
test esi, esi
jle 0x405b5e
push edi
call fcn.004087d0
add esp, 4
mov dword [ebx], eax
add ebx, 4
push edi
call fcn.004084e0
add esp, 4
dec esi
lea edi, [edi + eax + 1]
jne 0x405b40
mov eax, dword [ebp - 0xc]
lea ecx, [eax*4 + 4]
push ecx
call fcn.00403f50
add esp, 4
mov dword [ebp - 0xc], eax
test eax, eax
mov dword [0x41a90c], eax
jne 0x405b8a
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
mov edx, dword [ebp - 0x10]
lea eax, [edx*4 + 4]
push eax
call fcn.00403f50
mov edi, eax
add esp, 4
test edi, edi
mov dword [0x41a928], edi
mov dword [0x41a914], edi
jne 0x405bbc
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov esi, eax
mov al, byte [esi]
test al, al
je 0x405c6b
cmp al, 0x7e
jne 0x405bef
cmp dword [ebp - 8], 1
jne 0x405c54
lea ecx, [esi + 1]
push ecx
call fcn.004087d0
mov dword [ebx], eax
add esp, 4
add ebx, 4
test eax, eax
jne 0x405c54
jmp 0x405c47
cmp al, 0x3d
jne 0x405c0d
push esi
call fcn.004087d0
mov ecx, dword [ebp - 0xc]
add esp, 4
mov dword [ecx], eax
add ecx, 4
test eax, eax
mov dword [ebp - 0xc], ecx
jne 0x405c54
jmp 0x405c47
push 8
push esi
push str.MKSARGS
call fcn.0040b110
add esp, 0xc
test eax, eax
je 0x405c54
push 5
push esi
push str.path
call fcn.0040af50
add esp, 0xc
test eax, eax
je 0x405c54
push esi
call fcn.004087d0
mov dword [edi], eax
add esp, 4
add edi, 4
test eax, eax
jne 0x405c54
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
push esi
call fcn.004084e0
lea esi, [esi + eax + 1]
add esp, 4
mov al, byte [esi]
test al, al
jne 0x405bce
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x405ca5
push eax
call fcn.004087d0
add esp, 4
mov dword [edi], eax
test eax, eax
jne 0x405c8e
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
mov edx, dword [edi]
add edi, 4
mov byte [edx + 1], 0x41
mov eax, dword [edi - 4]
mov byte [eax + 2], 0x54
mov ecx, dword [edi - 4]
mov byte [ecx + 3], 0x48
mov eax, dword [ebp - 4]
test eax, eax
je 0x405cb2
mov dword [ebx], 0
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 8]
test eax, eax
mov dword [edx], 0
mov dword [edi], 0
jne 0x405e5f
push 0x20
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x20], 8
call fcn.00403f50
add esp, 4
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x405cfb
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
mov eax, dword [ebp - 0x2c]
add esp, 4
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x28], 0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov ebx, eax
push ebx
push ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.USER32.dll_CharToOemA]
mov ecx, dword [ebp - 4]
xor edx, edx
mov dword [ebp - 8], edx
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x1c], edx
mov al, byte [ecx]
cmp al, 0x20
je 0x405d30
cmp al, 9
jne 0x405d33
inc ecx
jmp 0x405d26
mov dword [ebp - 4], ecx
mov cl, byte [ecx]
test cl, cl
je 0x405e45
test cl, cl
mov dword [ebp - 0x10], ebx
mov byte [ebp - 0x18], cl
je 0x405df7
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x1c]
inc edx
test eax, eax
mov dword [ebp - 4], edx
jne 0x405df4
mov edi, dword [ebp - 0x18]
mov eax, edi
and eax, 0xff
lea esi, [eax - 9]
cmp esi, 0x53
ja case.0x405d7a.17
xor edx, edx
mov dl, byte [esi + 0x405edc]
jmp dword [edx*4 + 0x405eb8]
mov eax, dword [ebp - 8]
test eax, eax
je 0x405df7
mov byte [ebx], cl
inc ebx
jmp 0x405de2
mov edx, dword [ebp - 8]
test edx, edx
jne 0x405d99
mov dword [ebp - 8], eax
jmp 0x405de2
cmp eax, edx
jne 0x405dbe
mov dword [ebp - 8], 0
jmp 0x405de2
cmp dword [ebp - 8], 0x22
jne 0x405dbe
mov eax, dword [ebp - 4]
mov al, byte [eax]
cmp al, 0x22
jne 0x405dbe
mov cl, al
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 4], eax
mov byte [ebx], cl
inc ebx
jmp 0x405de2
mov eax, dword [ebp - 8]
test eax, eax
jne case.0x405d7a.17
inc dword [ebp - 0x14]
mov byte [ebx], cl
push edi
inc ebx
call dword [sym.imp.KERNEL32.dll_IsDBCSLeadByte]
test eax, eax
je 0x405de2
mov dword [ebp - 0x1c], 1
mov ecx, dword [ebp - 4]
mov cl, byte [ecx]
test cl, cl
mov byte [ebp - 0x18], cl
jne 0x405d4e
jmp 0x405df7
mov byte [ebx], cl
inc ebx
mov eax, dword [ebp - 0x14]
mov byte [ebx], 0
inc ebx
test eax, eax
je 0x405e30
mov eax, dword [ebp - 0x10]
lea edx, [ebp - 0x30]
push edx
push 0
push 0x28
push eax
call fcn.0040aa10
add esp, 0x10
test eax, eax
je 0x405d18
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.00405fd0
add esp, 4
jmp 0x405d18
mov ecx, dword [ebp - 0x10]
lea edx, [ebp - 0x30]
push ecx
push edx
call fcn.00405f30
add esp, 8
jmp 0x405d18
lea eax, [ebp - 0x30]
push edx
push eax
call fcn.00405f30
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x2c]
add esp, 8
dec ecx
mov dword [ebp - 4], ecx
mov dword [ebp - 0x1c], edx
mov eax, dword [0x4172a4]
test eax, eax
je 0x405e6e
call eax
test eax, eax
je 0x405e8d
mov eax, dword [0x41a914]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 4]
push eax
push ecx
push edx
call section..text
add esp, 0xc
push eax
call fcn.00403d80
add esp, 4
push 1
call fcn.00403d80
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 4], esi
je 0x405eb0
mov esi, 1
mov dword [ebp - 8], esi
jmp 0x405ae2
mov dword [ebp - 8], esi
jmp 0x405af1