Function at 0x401501
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 0x4052a0
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.00401d09
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 0x401673
add ecx, 4
mov dword [ebp - 4], ecx
mov eax, dword [ebp + 0xc]
push 0xb
mov edi, 0x4052b4
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 0x40160d
push 4
mov edi, 0x4052c0
mov esi, ebx
pop ecx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40160d
cmp byte [ebx], 0x2d
jne 0x401640
push ebx
call fcn.004026cb
test eax, eax
pop ecx
jl 0x4015ba
mov ecx, dword [0x4062e4]
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 0x4015fa
mov esi, dword [sym.imp.MSVCRT.dll_strncmp]
push 0xa
push 0x4052c4
push ebx
call esi
add esp, 0xc
test eax, eax
je 0x4015e2
push 0xc
push 0x4052d0
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x4015ff
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 0x401633
mov eax, dword [ebp - 4]
inc dword [ebp - 8]
add dword [ebp - 4], 4
mov dword [eax], ebx
jmp 0x4015fa
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 0x401633
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 0x40155c
cmp edx, dword [ebp - 0x14]
jge 0x40166a
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 0x401655
jmp 0x401670
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 0x401695
mov eax, dword [0x4062e4]
mov eax, dword [eax]
inc eax
jmp 0x401753
test esi, esi
jl 0x401753
mov eax, dword [0x4062e4]
lea ecx, [esi + esi*2]
cmp dword [eax + ecx*4 + 4], 1
jne 0x4016db
lea ecx, [esi + esi*2]
push dword [eax + ecx*4 + 8]
call fcn.004026cb
test eax, eax
pop ecx
jl 0x401703
mov dword [ebp - 0x10], eax
lea ecx, [eax + eax*2]
mov eax, dword [0x4062e4]
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 0x4016ac
lea ecx, [esi + esi*2]
mov ecx, dword [eax + ecx*4 + 4]
dec ecx
dec ecx
je 0x401727
dec ecx
jne 0x401750
push 1
push dword [ebp - 0xc]
push 0x40533c
call fcn.00402d4a
add esp, 0xc
push 1
call dword [sym.imp.MSVCRT.dll_exit]
mov ecx, dword [0x4062e4]
lea eax, [esi + esi*2]
push 1
push dword [ecx + eax*4 + 8]
push 0x4052e0
call fcn.00402d4a
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 0x405308
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
mov eax, dword [0x4062e4]
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