Function at 0x4212b5
Capabilities:
Accept command line arguments
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1a8
mov eax, dword [0x5836e0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
xor ecx, ecx
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
push 0x40
mov dword [ebp - 0x164], eax
mov dword [ebx], ecx
mov dword [eax], ecx
pop eax
push eax
push ecx
lea eax, [ebp - 0x1a4]
mov dword [ebp - 0x1a8], 0x44
push eax
call fcn.004f5a90
add esp, 0xc
lea eax, [ebp - 0x1a8]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
push 0x118
lea eax, [ebp - 0x134]
mov dword [ebp - 0x138], 0x11c
push 0
push eax
call fcn.004f5a90
lea eax, [ebp - 0x138]
push eax
call fcn.004e3525
push 0x800
call fcn.004e1c0a
mov edi, eax
add esp, 0x14
mov dword [ebp - 0x15c], edi
test edi, edi
je 0x42139a
mov esi, 0x400
push esi
push edi
push 0x52aa44
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ecx, eax
cmp ecx, esi
jb 0x42138c
lea esi, [ecx + 1]
lea eax, [esi + esi]
push eax
push edi
call fcn.004e1c5d
mov edi, eax
mov dword [ebp - 0x15c], edi
pop ecx
pop ecx
test edi, edi
je 0x42139a
push esi
push edi
push 0x52aa44
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov ecx, eax
lea eax, [esi - 1]
cmp eax, ecx
cmovb ecx, eax
xor eax, eax
mov word [edi + ecx*2], ax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push 2
push 0x208
mov dword [ebp - 0x150], eax
call fcn.004e1c42
mov esi, eax
mov dword [ebp - 0x160], esi
pop ecx
pop ecx
test esi, esi
je 0x4213ce
push 0x208
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 2
push 0x208
call fcn.004e1c42
mov dword [ebp - 0x148], eax
pop ecx
pop ecx
test eax, eax
je 0x4213f2
push eax
push 0x208
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
test edi, edi
je 0x421408
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
xor edx, edx
mov dword [ebp - 0x140], eax
jmp 0x421410
xor edx, edx
mov dword [ebp - 0x140], edx
test esi, esi
je 0x421428
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
xor edx, edx
lea ecx, [eax + 1]
mov dword [ebp - 0x158], ecx
jmp 0x421430
mov ecx, edx
mov dword [ebp - 0x158], edx
mov eax, dword [ebp - 0x140]
add eax, ecx
mov dword [ebp - 0x144], eax
mov eax, dword [ebp - 0x150]
test eax, eax
je 0x42145a
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
xor edx, edx
mov dword [ebp - 0x154], eax
jmp 0x421462
mov eax, edx
mov dword [ebp - 0x154], edx
mov ecx, dword [ebp - 0x144]
add ecx, eax
mov eax, dword [ebp - 0x148]
mov dword [ebp - 0x13c], ecx
test eax, eax
je 0x421492
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [ebp - 0x13c]
inc eax
mov dword [ebp - 0x144], eax
xor edx, edx
jmp 0x42149a
mov eax, edx
mov dword [ebp - 0x144], edx
add eax, ecx
cmp dword [ebp - 0x19c], 0
mov dword [ebp - 0x14c], eax
je 0x4214c0
push dword [ebp - 0x19c]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
mov dword [ebp - 0x13c], eax
jmp 0x4214c8
mov eax, edx
mov dword [ebp - 0x13c], edx
add eax, dword [ebp - 0x14c]
mov ecx, dword [ebp + 8]
add ecx, 0xa68
push 1
lea eax, [ecx + eax*2]
push eax
mov dword [ebp - 0x14c], eax
call fcn.004e1c42
mov dword [ebx], eax
pop ecx
pop ecx
test eax, eax
je 0x421791
mov ecx, dword [ebp - 0x14c]
mov dword [eax], ecx
call fcn.004e3cd3
push 0x20
pop ecx
test al, al
push 0x40
pop eax
cmovne ecx, eax
mov eax, dword [ebx]
mov dword [eax + 0x4c], ecx
call fcn.004e6463
mov ecx, dword [ebx]
lea esi, [ebp - 0x1a8]
push 0x11
mov dword [ecx + 0x54], eax
mov edi, dword [ebx]
pop ecx
add edi, 4
rep movsd dword es:[edi], dword [esi]
mov edi, dword [ebx]
lea esi, [ebp - 0x138]
push 0x47
pop ecx
add edi, 0x58
rep movsd dword es:[edi], dword [esi]
test dword [ebp - 0x17c], 0x100
mov ecx, dword [ebp - 0x16c]
mov esi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0
pop eax
cmovne ecx, eax
mov eax, dword [ebx]
push 0x1000
mov dword [eax + 0x48], ecx
call esi
mov ecx, dword [ebx]
mov dword [ecx + 0x1b0], eax
call fcn.004e3b22
movzx ecx, al
mov eax, dword [ebx]
push 0x52
mov dword [eax + 0x1c8], ecx
call esi
mov ecx, dword [ebx]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push 2
mov dword [ecx + 0x1cc], eax
mov eax, dword [ebx]
pop ecx
push 0x52aa34
mov dword [eax + 0x1b8], ecx
mov eax, dword [ebx]
mov dword [eax + 0x1bc], ecx
mov eax, dword [ebx]
mov dword [eax + 0x1c0], ecx
call esi
mov edi, eax
lea eax, [ebp - 0x124]
push eax
call esi
lea ecx, [ebp - 0x122]
xor esi, esi
lea ecx, [ecx + eax*2]
cmp word [ecx], si
je 0x4215f6
lea eax, [edi + 1]
lea eax, [ecx + eax*2]
lea edx, [ebp - 0x24]
cmp eax, edx
jae 0x4215f6
push 0x52aa34
xor eax, eax
push ecx
mov word [ecx + edi*2], ax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
mov ecx, dword [ebx]
neg eax
sbb eax, eax
inc eax
mov dword [ecx + 0x1c4], eax
call dword [sym.imp.KERNEL32.dll_GetACP]
mov ecx, dword [ebx]
mov dword [ecx + 0x1d0], eax
call dword [sym.imp.KERNEL32.dll_GetOEMCP]
mov ecx, dword [ebx]
push str.kernel32.dll
mov dword [ecx + 0x1d4], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x42165f
push str.GetConsoleHistoryInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x42165f
mov ecx, dword [ebx]
mov dword [ecx + 0x174], 0x10
mov ecx, dword [ebx]
add ecx, 0x174
push ecx
call eax
test eax, eax
jne 0x42165f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebx]
or eax, 0x80000000
mov dword [ecx + 0x174], eax
mov ecx, dword [ebx]
mov dword [ebp - 0x18], 0xfffffff6
mov dword [ebp - 0x10], 0xfffffff5
mov dword [ebp - 8], 0xfffffff4
lea eax, [ecx + 0x184]
mov dword [ebp - 0x1c], eax
lea eax, [ecx + 0x18c]
mov dword [ebp - 0x14], eax
lea eax, [ecx + 0x194]
mov dword [ebp - 0xc], eax
push dword [ebp + esi*8 - 0x18]
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, dword [ebp + esi*8 - 0x1c]
lea edi, [ecx + 4]
mov dword [ecx], eax
push edi
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x4216b3
or dword [edi], 0xffffffff
inc esi
cmp esi, 3
jb 0x421691
mov esi, dword [ebx]
mov eax, dword [ebp - 0x150]
add esi, 0xa68
test eax, eax
je 0x4216e4
mov edi, dword [ebp - 0x154]
push eax
push edi
push esi
call fcn.00401a0b
mov eax, dword [ebx]
mov dword [eax + 0x19c], esi
lea esi, [esi + edi*2]
mov eax, dword [ebp - 0x160]
test eax, eax
je 0x421707
mov edi, dword [ebp - 0x158]
push eax
push edi
push esi
call fcn.00401a0b
mov eax, dword [ebx]
mov dword [eax + 0x1a0], esi
lea esi, [esi + edi*2]
mov eax, dword [ebp - 0x148]
test eax, eax
je 0x42172a
mov edi, dword [ebp - 0x144]
push eax
push edi
push esi
call fcn.00401a0b
mov eax, dword [ebx]
mov dword [eax + 0x1a4], esi
lea esi, [esi + edi*2]
mov edi, dword [ebp - 0x15c]
test edi, edi
je 0x42175a
push edi
push dword [ebp - 0x140]
push esi
call fcn.00401a0b
mov eax, dword [ebx]
mov ecx, dword [ebp - 0x140]
mov dword [eax + 0x1a8], esi
mov eax, dword [ebx]
lea esi, [esi + ecx*2]
mov dword [eax + 0x1ac], ecx
cmp dword [ebp - 0x19c], 0
je 0x421783
push dword [ebp - 0x19c]
push dword [ebp - 0x13c]
push esi
call fcn.00401a0b
mov eax, dword [ebx]
mov dword [eax + 0x10], esi
mov eax, dword [ebp - 0x13c]
lea esi, [esi + eax*2]
mov eax, dword [ebp - 0x164]
mov dword [eax], esi
mov esi, dword [ebp - 0x160]
test edi, edi
je 0x42179c
push edi
call fcn.004e1bea
pop ecx
test esi, esi
je 0x4217a7
push esi
call fcn.004e1bea
pop ecx
mov eax, dword [ebp - 0x148]
test eax, eax
je 0x4217b8
push eax
call fcn.004e1bea
pop ecx
pop edi
xor ecx, ecx
cmp dword [ebx], ecx
pop esi
pop ebx
je 0x4217d0
mov eax, dword [ebp - 0x164]
cmp dword [eax], ecx
je 0x4217d0
xor eax, eax
inc eax
jmp 0x4217d2
mov al, cl
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004f4166
leave
ret