Function at 0x4039d0
Capabilities:
Parse pe header
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
mov eax, dword [ebp + 8]
cmp dword [ebp + 8], 0
jne 0x4039ef
mov dword [ebp - 4], 0
jmp 0x403dda
mov eax, dword [ebp + 8]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
movzx eax, word [eax]
cmp eax, 0x5a4d
je 0x403ac3
lea ecx, [ebp - 9]
call fcn.00403df0
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0xa]
call fcn.00403ea0
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f08e]
mov dword [ebp - 0xe], eax
lea ecx, [ebp - 0xf]
call fcn.00403f50
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x403aa0
lea eax, [ebp - 0xe]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x403a9d
lea ecx, [ebp - 0x15]
call fcn.00404000
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.004040b0
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov dword [ebp - 4], 0
jmp 0x403dda
mov dword [ebp - 0x1c], 0x400
lea ecx, [ebp - 0x1d]
call fcn.00404160
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x1e]
call fcn.00404210
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f092]
mov dword [ebp - 0x22], eax
lea ecx, [ebp - 0x23]
call fcn.004042c0
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x403b64
lea eax, [ebp - 0x22]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x403b61
lea ecx, [ebp - 0x29]
call fcn.00404370
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 - 0x28]
lea ecx, [ebp - 0x2a]
call fcn.00404420
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov eax, dword [ebp - 8]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x30], eax
lea ecx, [ebp - 0x31]
call fcn.004044d0
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x32]
call fcn.00404580
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f096]
mov dword [ebp - 0x36], eax
lea ecx, [ebp - 0x37]
call fcn.00404630
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x403c1e
lea eax, [ebp - 0x36]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x403c1b
lea ecx, [ebp - 0x3d]
call fcn.004046e0
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 - 0x3c]
lea ecx, [ebp - 0x3e]
call fcn.00404790
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
cmp dword [ebp - 0x30], 0x400
jle 0x403c4e
mov dword [ebp - 4], 0
jmp 0x403dda
lea ecx, [ebp - 0x3f]
call fcn.00404840
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x40]
call fcn.004048f0
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f09a]
mov dword [ebp - 0x44], eax
lea ecx, [ebp - 0x45]
call fcn.004049a0
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x403ce8
lea eax, [ebp - 0x44]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x4c], 0
jne 0x403ce5
lea ecx, [ebp - 0x4d]
call fcn.00404a50
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 - 0x4c]
lea ecx, [ebp - 0x4e]
call fcn.00404b00
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x30]
mov dword [ebp - 0x54], eax
lea ecx, [ebp - 0x55]
call fcn.00404bb0
mov ecx, eax
call fcn.00401a80
mov dword [esp], eax
call fcn.00401450
lea ecx, [ebp - 0x56]
call fcn.00404c60
mov ecx, eax
call fcn.00401b50
mov dword [esp], eax
call fcn.00401450
mov eax, dword [0x48f09e]
mov dword [ebp - 0x5a], eax
lea ecx, [ebp - 0x5b]
call fcn.00404d10
mov ecx, eax
call fcn.004025c0
mov dword [esp], eax
call sub.msvcrt.dll_getenv
cmp eax, 0
je 0x403da2
lea eax, [ebp - 0x5a]
mov dword [esp], eax
call fcn.00401c40
mov dword [ebp - 0x60], eax
cmp dword [ebp - 0x60], 0
jne 0x403d9f
lea ecx, [ebp - 0x61]
call fcn.00404dc0
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 - 0x60]
lea ecx, [ebp - 0x62]
call fcn.00404e70
mov ecx, eax
call fcn.00401e00
mov dword [esp], eax
call fcn.00401450
mov eax, dword [ebp - 0x54]
cmp dword [eax], 0x4550
je 0x403dd4
mov dword [ebp - 4], 0
jmp 0x403dda
mov eax, dword [ebp - 0x54]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
add esp, 0x68
pop ebp
ret