Function at 0x401532
Capabilities:
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push 0x408314
or edi, 0xffffffff
call dword [sym.imp.MSVCRT.dll_getenv]
mov esi, eax
mov eax, dword [ebp + 8]
mov ebx, dword [eax]
mov dword [ebp - 0x14], ebx
lea eax, [ebx*4 + 4]
push eax
call fcn.00402077
pop ecx
mov dword [ebp - 0x10], eax
pop ecx
mov ecx, dword [ebp + 0xc]
push 1
mov ecx, dword [ecx]
mov ecx, dword [ecx]
mov dword [eax], ecx
pop ecx
cmp ebx, ecx
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], ecx
jle 0x401624
lea ecx, [eax + 4]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0xc]
mov ecx, dword [ecx]
mov ebx, dword [ecx + edx*4]
cmp byte [ebx], 0x2d
je 0x4015a3
mov ecx, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov dword [ecx], ebx
jmp 0x401615
push ebx
call fcn.00402cec
test eax, eax
pop ecx
jl 0x4015c4
mov ecx, dword [0x40ac54]
mov edi, eax
lea eax, [eax + eax*2]
mov esi, dword [ecx + eax*4]
mov eax, dword [ebp + 8]
inc esi
dec dword [eax]
jmp 0x401612
push 0xa
push 0x408328
push ebx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x4015ee
push 0xc
push 0x408334
push ebx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x401606
xor eax, eax
cmp byte [ebx + 1], 0x58
setne al
dec eax
and al, 0xfe
add eax, 0xc
add eax, ebx
or edi, 0xffffffff
mov esi, eax
jmp 0x401612
mov eax, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov dword [eax], ebx
mov eax, dword [ebp - 0x10]
inc dword [ebp - 0xc]
mov ecx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0x14]
jl 0x401585
mov ecx, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
xor ebx, ebx
mov dword [eax + ecx*4], ebx
mov dword [edx], eax
mov eax, dword [ebp + 8]
cmp esi, ebx
mov dword [eax], ecx
jne 0x401647
mov eax, dword [0x40ac54]
mov eax, dword [eax]
inc eax
jmp 0x40174a
cmp edi, ebx
jl 0x401748
mov eax, dword [0x40ac54]
lea ecx, [edi + edi*2]
cmp dword [eax + ecx*4 + 4], 1
jne 0x40168f
lea ecx, [edi + edi*2]
push dword [eax + ecx*4 + 8]
call fcn.00402cec
cmp ebx, dword [0x40ac58]
pop ecx
jg 0x4016c3
test eax, eax
jl 0x4016e6
mov edi, eax
lea ecx, [eax + eax*2]
mov eax, dword [0x40ac54]
mov esi, dword [eax + ecx*4]
lea ecx, [eax + ecx*4]
inc esi
inc ebx
cmp dword [ecx + 4], 1
je 0x40165e
lea ecx, [edi + edi*2]
mov ecx, dword [eax + ecx*4 + 4]
dec ecx
dec ecx
je 0x40171e
dec ecx
jne 0x401748
cmp byte [ebp + 0x10], 0
jne 0x401717
push 1
push esi
push 0x4083e4
call fcn.00403344
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
cmp byte [ebp + 0x10], 0
jne 0x4016df
push 1
push 0x408344
call fcn.00403321
pop ecx
pop ecx
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, 0x408378
jmp 0x40174a
cmp byte [ebp + 0x10], 0
jne 0x401710
mov ecx, dword [0x40ac54]
lea eax, [edi + edi*2]
push 1
push dword [ecx + eax*4 + 8]
push 0x408380
call fcn.00403344
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, 0x4083a8
jmp 0x40174a
mov eax, 0x408400
jmp 0x40174a
cmp byte [ebp + 0x10], 0
jne 0x401745
mov eax, dword [eax]
inc eax
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push esi
add eax, 0x40
push 0x4083b0
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
mov eax, dword [0x40ac54]
add esp, 0x10
mov esi, dword [eax]
inc esi
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret