Function at 0x401537
Capabilities:
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push 0x408308
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.0040207c
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 0x401629
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 0x4015a8
mov ecx, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov dword [ecx], ebx
jmp 0x40161a
push ebx
call fcn.00402d00
test eax, eax
pop ecx
jl 0x4015c9
mov ecx, dword [0x40ac64]
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 0x401617
push 0xa
push 0x40831c
push ebx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x4015f3
push 0xc
push 0x408328
push ebx
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x40160b
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 0x401617
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 0x40158a
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 0x40164c
mov eax, dword [0x40ac64]
mov eax, dword [eax]
inc eax
jmp 0x40174f
cmp edi, ebx
jl 0x40174d
mov eax, dword [0x40ac64]
lea ecx, [edi + edi*2]
cmp dword [eax + ecx*4 + 4], 1
jne 0x401694
lea ecx, [edi + edi*2]
push dword [eax + ecx*4 + 8]
call fcn.00402d00
cmp ebx, dword [0x40ac68]
pop ecx
jg 0x4016c8
test eax, eax
jl 0x4016eb
mov edi, eax
lea ecx, [eax + eax*2]
mov eax, dword [0x40ac64]
mov esi, dword [eax + ecx*4]
lea ecx, [eax + ecx*4]
inc esi
inc ebx
cmp dword [ecx + 4], 1
je 0x401663
lea ecx, [edi + edi*2]
mov ecx, dword [eax + ecx*4 + 4]
dec ecx
dec ecx
je 0x401723
dec ecx
jne 0x40174d
cmp byte [ebp + 0x10], 0
jne 0x40171c
push 1
push esi
push 0x4083d8
call fcn.00403358
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
cmp byte [ebp + 0x10], 0
jne 0x4016e4
push 1
push 0x408338
call fcn.00403335
pop ecx
pop ecx
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, 0x40836c
jmp 0x40174f
cmp byte [ebp + 0x10], 0
jne 0x401715
mov ecx, dword [0x40ac64]
lea eax, [edi + edi*2]
push 1
push dword [ecx + eax*4 + 8]
push 0x408374
call fcn.00403358
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, 0x40839c
jmp 0x40174f
mov eax, 0x4083f4
jmp 0x40174f
cmp byte [ebp + 0x10], 0
jne 0x40174a
mov eax, dword [eax]
inc eax
push eax
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push esi
add eax, 0x40
push 0x4083a4
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
mov eax, dword [0x40ac64]
add esp, 0x10
mov esi, dword [eax]
inc esi
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret