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

Disassembly:
push ebp
mov ebp, esp
push esi
sub esp, 0x7c
mov eax, dword [0x4a1740]
xor ecx, ecx
mov dword [esp], 0xfde9
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
sub esp, 0x18
mov dword [ebp - 8], eax
lea ecx, [ebp - 9]
call fcn.00402c10
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0xa]
call fcn.00402cc0
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f07e]
mov dword [ebp - 0xe], eax
lea ecx, [ebp - 0xf]
call fcn.00402d70
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x4027ef
lea eax, [ebp - 0xe]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4027ec
lea ecx, [ebp - 0x15]
call fcn.00402e20
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401c50
xor eax, eax
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GlobalFlags]
sub esp, 4
call dword [ebp - 0x14]
lea ecx, [ebp - 0x16]
call fcn.00402ed0
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov eax, dword [ebp - 8]
add eax, 1
mov dword [esp], eax
mov dword [esp + 4], 2
call sub.msvcrt.dll_calloc
mov dword [0x4a1744], eax
lea ecx, [ebp - 0x17]
call fcn.00402f80
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x18]
call fcn.00403030
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f082]
mov dword [ebp - 0x1c], eax
lea ecx, [ebp - 0x1d]
call fcn.004030e0
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x4028bb
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x4028b8
lea ecx, [ebp - 0x25]
call fcn.00403190
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401c50
xor eax, eax
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GlobalFlags]
sub esp, 4
call dword [ebp - 0x24]
lea ecx, [ebp - 0x26]
call fcn.00403240
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov edx, dword [0x4a1740]
mov ecx, dword [0x4a1744]
mov eax, dword [ebp - 8]
xor esi, esi
mov dword [esp], 0xfde9
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
sub esp, 0x18
lea ecx, [ebp - 0x27]
call fcn.004032f0
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x28]
call fcn.004033a0
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f086]
mov dword [ebp - 0x2c], eax
lea ecx, [ebp - 0x2d]
call fcn.00403450
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x4029a9
lea eax, [ebp - 0x2c]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
jne 0x4029a6
lea ecx, [ebp - 0x35]
call fcn.00403500
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401c50
xor eax, eax
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GlobalFlags]
sub esp, 4
call dword [ebp - 0x34]
lea ecx, [ebp - 0x36]
call fcn.004035b0
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov ecx, dword [0x4a1744]
lea eax, [0x4a1748]
mov dword [esp], ecx
mov dword [esp + 4], eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
sub esp, 8
mov dword [0x4a173c], eax
lea ecx, [ebp - 0x37]
call fcn.00403660
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x38]
call fcn.00403710
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f08a]
mov dword [ebp - 0x3c], eax
lea ecx, [ebp - 0x3d]
call fcn.004037c0
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x402a7b
lea eax, [ebp - 0x3c]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x402a78
lea ecx, [ebp - 0x45]
call fcn.00403870
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401c50
xor eax, eax
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GlobalFlags]
sub esp, 4
call dword [ebp - 0x44]
lea ecx, [ebp - 0x46]
call fcn.00403920
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x4a1748]
shl eax, 2
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x54], 0
mov eax, dword [ebp - 0x54]
cmp eax, dword [0x4a1748]
jge 0x402b1e
mov eax, dword [0x4a173c]
mov ecx, dword [ebp - 0x54]
mov eax, dword [eax + ecx*4]
xor ecx, ecx
mov dword [esp], 0xfde9
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
sub esp, 0x20
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x4c]
add eax, dword [ebp - 0x50]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x54]
add eax, 1
mov dword [ebp - 0x54], eax
jmp 0x402aa4
mov eax, dword [ebp - 0x50]
xor ecx, ecx
mov dword [esp], 0
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
sub esp, 8
mov dword [0x4a1738], eax
mov eax, dword [ebp - 0x50]
mov ecx, dword [0x4a1748]
shl ecx, 2
sub eax, ecx
mov dword [ebp - 0x58], eax
mov eax, dword [0x4a1738]
mov ecx, dword [0x4a1748]
shl ecx, 2
add eax, ecx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x60], 0
mov eax, dword [ebp - 0x60]
cmp eax, dword [0x4a1748]
jge 0x402bf8
mov eax, dword [0x4a173c]
mov ecx, dword [ebp - 0x60]
mov edx, dword [eax + ecx*4]
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x58]
xor esi, esi
mov dword [esp], 0xfde9
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
sub esp, 0x20
mov dword [ebp - 0x4c], eax
mov edx, dword [ebp - 0x5c]
mov eax, dword [0x4a1738]
mov ecx, dword [ebp - 0x60]
mov dword [eax + ecx*4], edx
mov eax, dword [ebp - 0x4c]
add eax, dword [ebp - 0x5c]
mov dword [ebp - 0x5c], eax
mov ecx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x58]
sub eax, ecx
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x60]
add eax, 1
mov dword [ebp - 0x60], eax
jmp 0x402b67
mov dword [0x4a1734], 1
add esp, 0x7c
pop esi
pop ebp
ret