Function at 0x401536
Capabilities:
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
or esi, 0xffffffff
push 0x405298
mov dword [ebp - 0x10], esi
call dword [sym.imp.MSVCRT.dll_getenv]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov edi, dword [eax]
mov dword [ebp - 0x14], edi
lea eax, [edi*4 + 4]
push eax
call fcn.00401d43
pop ecx
pop ecx
mov ecx, eax
mov eax, dword [ebp + 0xc]
push 1
mov dword [ebp - 0x1c], ecx
mov eax, dword [eax]
pop edx
mov ebx, edx
cmp edi, edx
mov eax, dword [eax]
mov dword [ebp - 8], ebx
mov dword [ecx], eax
mov dword [ebp - 0x18], edx
jle 0x4016a8
add ecx, 4
mov dword [ebp - 4], ecx
mov eax, dword [ebp + 0xc]
push 0xb
mov edi, 0x4052ac
pop ecx
mov eax, dword [eax]
mov ebx, dword [eax + edx*4]
xor eax, eax
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x401642
push 4
mov edi, 0x4052b8
mov esi, ebx
pop ecx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x401642
cmp byte [ebx], 0x2d
jne 0x401675
push ebx
call fcn.004027ad
test eax, eax
pop ecx
jl 0x4015ef
mov ecx, dword [0x40635c]
mov dword [ebp - 0x10], eax
lea eax, [eax + eax*2]
mov eax, dword [ecx + eax*4]
inc eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
dec dword [eax]
jmp 0x40162f
mov esi, dword [sym.imp.MSVCRT.dll_strncmp]
push 0xa
push 0x4052bc
push ebx
call esi
add esp, 0xc
test eax, eax
je 0x401617
push 0xc
push 0x4052c8
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x401634
xor eax, eax
cmp byte [ebx + 1], 0x58
setne al
dec eax
and al, 0xfe
add eax, 0xc
add eax, ebx
or dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0xc], eax
mov edx, dword [ebp - 0x18]
jmp 0x401668
mov eax, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov dword [eax], ebx
jmp 0x40162f
mov eax, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
inc edx
cmp edx, dword [ebp - 0x14]
mov dword [eax], ebx
jge 0x401668
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov eax, dword [eax]
mov eax, dword [eax + edx*4]
mov dword [ecx], eax
inc edx
cmp edx, dword [ebp - 0x14]
mov dword [ebp - 0x18], edx
jl 0x401591
cmp edx, dword [ebp - 0x14]
jge 0x40169f
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0x14]
sub esi, edx
lea eax, [ecx + ebx*4]
add ebx, esi
mov esi, dword [ebp + 0xc]
mov esi, dword [esi]
mov esi, dword [esi + edx*4]
mov dword [eax], esi
add eax, 4
inc edx
cmp edx, dword [ebp - 0x14]
jl 0x40168a
jmp 0x4016a5
mov ebx, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x10]
mov eax, dword [ebp + 0xc]
and dword [ecx + ebx*4], 0
mov dword [eax], ecx
mov eax, dword [ebp + 8]
mov dword [eax], ebx
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x4016ca
mov eax, dword [0x40635c]
mov eax, dword [eax]
inc eax
jmp 0x401798
test esi, esi
jl 0x401798
mov eax, dword [0x40635c]
lea ecx, [esi + esi*2]
cmp dword [eax + ecx*4 + 4], 1
jne 0x401710
lea ecx, [esi + esi*2]
push dword [eax + ecx*4 + 8]
call fcn.004027ad
test eax, eax
pop ecx
jl 0x401740
mov dword [ebp - 0x10], eax
lea ecx, [eax + eax*2]
mov eax, dword [0x40635c]
mov esi, dword [ebp - 0x10]
mov edx, dword [eax + ecx*4]
lea ecx, [eax + ecx*4]
inc edx
cmp dword [ecx + 4], 1
mov dword [ebp - 0xc], edx
je 0x4016e1
lea ecx, [esi + esi*2]
mov ecx, dword [eax + ecx*4 + 4]
dec ecx
dec ecx
je 0x40176c
dec ecx
jne 0x401795
push dword [ebp - 0xc]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push 0x405334
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, dword [0x40635c]
lea eax, [esi + esi*2]
push dword [ecx + eax*4 + 8]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x40
push 0x4052d8
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, dword [eax]
inc eax
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push dword [ebp - 0xc]
add eax, 0x40
push 0x405300
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
mov eax, dword [0x40635c]
add esp, 0x10
mov eax, dword [eax]
inc eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
leave
ret