Function at 0x4021c0
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 [0x40cd0c], eax
call fcn.00404770
test eax, eax
jge 0x40220b
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
call dword [sym.imp.KERNEL32.dll_SetFileApisToOEM]
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov cl, byte [eax]
test cl, cl
je 0x40222f
cmp cl, 0x20
je 0x40222f
cmp cl, 9
je 0x40222f
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40221d
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 0x40230c
cmp al, 0x7e
jne 0x402266
inc dword [ebp - 4]
jmp 0x4022f5
cmp al, 0x3d
jne 0x402272
inc dword [ebp - 0xc]
jmp 0x4022f5
push 8
push esi
push str.MKSARGS
call fcn.00404710
add esp, 0xc
test eax, eax
jne 0x4022c4
push 0x10
lea edx, [esi + 8]
push eax
push edx
call fcn.004045c0
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 0x4022bf
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
cmp eax, dword [edi + 8]
jne 0x4022bf
inc dword [ebp - 8]
jmp 0x4022f5
or ebx, 0xffffffff
jmp 0x4022f5
push 5
push esi
push str.PATH
call fcn.00404710
add esp, 0xc
test eax, eax
jne 0x4022db
mov dword [ebp - 0x18], esi
push 5
push esi
push str.Path
call fcn.00404710
add esp, 0xc
test eax, eax
jne 0x4022f2
mov dword [ebp - 0x1c], esi
inc dword [ebp - 0x10]
push esi
call fcn.004036a0
lea esi, [esi + eax + 1]
add esp, 4
mov al, byte [esi]
test al, al
jne 0x40225a
mov eax, dword [ebp - 0x18]
xor esi, esi
cmp eax, esi
jne 0x40231c
mov eax, dword [ebp - 0x1c]
cmp eax, esi
je 0x40231f
mov dword [ebp - 0x14], eax
cmp dword [ebp - 8], esi
jne 0x40232c
mov dword [ebp - 4], esi
mov dword [ebp - 8], esi
jmp 0x40234c
cmp ebx, 0xffffffff
je 0x402693
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 0x402357
mov eax, dword [edi + 0x10]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
test eax, eax
je 0x402388
mov ecx, eax
lea edx, [ecx*4 + 4]
push edx
call fcn.00403420
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [ebp - 0x1c], ebx
jne 0x40238b
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
jmp 0x40238b
mov ebx, dword [ebp - 0x1c]
cmp dword [ebp - 8], 2
jne 0x4023b9
mov esi, dword [ebp - 4]
add edi, 0x14
test esi, esi
jle 0x4023b9
push edi
call fcn.004036c0
add esp, 4
mov dword [ebx], eax
add ebx, 4
push edi
call fcn.004036a0
add esp, 4
dec esi
lea edi, [edi + eax + 1]
jne 0x40239b
mov eax, dword [ebp - 0xc]
lea ecx, [eax*4 + 4]
push ecx
call fcn.00403420
add esp, 4
mov dword [ebp - 0xc], eax
test eax, eax
mov dword [0x40cd20], eax
jne 0x4023e5
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
mov edx, dword [ebp - 0x10]
lea eax, [edx*4 + 4]
push eax
call fcn.00403420
mov edi, eax
add esp, 4
test edi, edi
mov dword [0x40cd3c], edi
mov dword [0x40cd28], edi
jne 0x402417
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov esi, eax
mov al, byte [esi]
test al, al
je 0x4024c6
cmp al, 0x7e
jne 0x40244a
cmp dword [ebp - 8], 1
jne 0x4024af
lea ecx, [esi + 1]
push ecx
call fcn.004036c0
mov dword [ebx], eax
add esp, 4
add ebx, 4
test eax, eax
jne 0x4024af
jmp 0x4024a2
cmp al, 0x3d
jne 0x402468
push esi
call fcn.004036c0
mov ecx, dword [ebp - 0xc]
add esp, 4
mov dword [ecx], eax
add ecx, 4
test eax, eax
mov dword [ebp - 0xc], ecx
jne 0x4024af
jmp 0x4024a2
push 8
push esi
push str.MKSARGS
call fcn.00404710
add esp, 0xc
test eax, eax
je 0x4024af
push 5
push esi
push str.path
call fcn.00404550
add esp, 0xc
test eax, eax
je 0x4024af
push esi
call fcn.004036c0
mov dword [edi], eax
add esp, 4
add edi, 4
test eax, eax
jne 0x4024af
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
push esi
call fcn.004036a0
lea esi, [esi + eax + 1]
add esp, 4
mov al, byte [esi]
test al, al
jne 0x402429
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x402500
push eax
call fcn.004036c0
add esp, 4
mov dword [edi], eax
test eax, eax
jne 0x4024e9
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
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 esi, dword [ebp - 4]
test esi, esi
je 0x40250d
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 0x402657
push 0x20
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x20], 8
call fcn.00403420
add esp, 4
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x402556
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
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 esi, eax
mov edi, esi
xor edx, edx
mov dword [ebp - 0x14], edx
xor eax, eax
mov al, byte [edi]
cmp eax, 0x20
je 0x40257d
cmp eax, 9
jne 0x402580
inc edi
jmp 0x40256f
mov al, byte [edi]
test al, al
je 0x40262d
and eax, 0xff
mov dword [ebp - 0x1c], esi
je 0x4025e2
lea ecx, [eax - 9]
inc edi
cmp ecx, 0x53
ja case.0x4025a5.17
xor ebx, ebx
mov bl, byte [ecx + 0x4026d4]
jmp dword [ebx*4 + 0x4026b0]
test edx, edx
je 0x4025e2
jmp case.0x4025a5.17
test edx, edx
jne 0x4025ba
mov edx, eax
jmp 0x4025da
cmp eax, edx
jne case.0x4025a5.17
xor edx, edx
jmp 0x4025da
cmp edx, 0x22
jne case.0x4025a5.17
cmp byte [edi], dl
jne case.0x4025a5.17
mov eax, edx
inc edi
jmp case.0x4025a5.17
test edx, edx
jne case.0x4025a5.17
inc dword [ebp - 0x14]
mov byte [esi], al
inc esi
xor eax, eax
mov al, byte [edi]
test eax, eax
jne 0x402594
mov eax, dword [ebp - 0x14]
mov byte [esi], 0
inc esi
test eax, eax
je 0x402603
mov ecx, dword [ebp - 0x1c]
lea eax, [ebp - 0x30]
push eax
push 0
push 0x28
push ecx
call fcn.00403ff0
add esp, 0x10
jmp 0x402613
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 0x30]
push edx
push eax
call fcn.00402730
add esp, 8
test eax, eax
je 0x40256a
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
jmp 0x40256a
lea ecx, [ebp - 0x30]
push 0
push ecx
call fcn.00402730
add esp, 8
test eax, eax
je 0x40264c
push str._main:_memory_allocation_error_during_startup._r_n
call fcn.004027c0
add esp, 4
mov edx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
lea esi, [edx - 1]
jmp 0x40265a
mov edi, dword [ebp - 0x1c]
mov eax, dword [0x409dd0]
test eax, eax
je 0x402669
call eax
test eax, eax
je 0x402682
mov eax, dword [0x40cd28]
push eax
push edi
push esi
call fcn.00401000
add esp, 0xc
push eax
call fcn.00403f60
add esp, 4
push 1
call fcn.00403f60
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 4], esi
je 0x4026a5
mov esi, 1
mov dword [ebp - 8], esi
jmp 0x40233d
mov dword [ebp - 8], esi
jmp 0x40234c