Function at 0x401000
Capabilities:
Query environment variable
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x238
push ebx
push esi
push edi
mov edi, dword [sym.imp.MSVCRT.dll_getenv]
xor ebx, ebx
push 0x408094
and byte [ebp - 0x14], bl
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 8], 0x408064
call edi
mov esi, dword [sym.imp.MSVCRT.dll_printf]
pop ecx
test eax, eax
je 0x40104e
push 0x4080ac
mov byte [0x40ac62], 1
call esi
pop ecx
lea eax, [ebp - 0x28]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00401834
mov eax, dword [ebp + 8]
lea eax, [eax*4 + 4]
push eax
call fcn.0040207c
mov edx, dword [ebp + 8]
add esp, 0x10
xor ecx, ecx
inc edx
test edx, edx
jle 0x40108c
mov edx, dword [ebp + 0xc]
mov edx, dword [edx + ecx*4]
mov dword [eax + ecx*4], edx
mov edx, dword [ebp + 8]
inc ecx
inc edx
cmp ecx, edx
jl 0x40107a
push eax
mov eax, 0x104
lea ecx, [ebp - 0x134]
push eax
push ecx
push eax
lea eax, [ebp - 0x238]
push eax
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp + 8]
push eax
call fcn.00402dc5
add esp, 0x1c
cmp byte [0x40ac62], 0
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], ebx
je 0x4010cd
call fcn.004032b1
mov ebx, eax
mov dword [ebp - 0x20], edx
jmp 0x4010d0
mov ebx, dword [ebp - 0x24]
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x134]
push eax
call fcn.00402fd2
pop ecx
test al, al
pop ecx
jne 0x4010ee
push 6
call dword [sym.imp.MSVCRT.dll_exit]
cmp byte [0x40ac62], 0
je 0x401113
call fcn.004032b1
sub eax, ebx
sbb edx, dword [ebp - 0x20]
push edx
push eax
call fcn.004032f7
push eax
push 0x4080cc
call esi
add esp, 0x10
add dword [ebp + 0xc], 4
dec dword [ebp + 8]
lea eax, [ebp + 0xc]
mov dword [0x40ac58], 0x4080f0
push eax
lea eax, [ebp + 8]
push eax
call fcn.0040236c
pop ecx
pop ecx
call fcn.00402445
test al, al
jne 0x401144
push 1
call dword [sym.imp.MSVCRT.dll_exit]
push 0x4080f8
call edi
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp + 8]
push eax
call fcn.00401b47
add esp, 0x18
test al, al
jne 0x401174
push dword [ebp - 0x18]
call dword [sym.imp.MSVCRT.dll_exit]
xor edi, edi
cmp dword [ebp - 0x10], edi
je 0x401184
push dword [ebp - 0x10]
call fcn.00401754
pop ecx
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 0x10]
push dword [ebp - 0xc]
call fcn.004025f6
call fcn.00402702
push 0x408108
call fcn.00403651
add esp, 0x14
cmp byte [0x40ac62], 0
je 0x4011ba
call fcn.004032b1
mov ebx, eax
mov dword [ebp - 0x20], edx
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.00401fbb
add esp, 0xc
test al, al
jne 0x4011e8
push 1
push 0x40811c
call fcn.00403335
pop ecx
pop ecx
push 1
call dword [sym.imp.MSVCRT.dll_exit]
cmp byte [0x40ac60], 0
jne 0x4011fa
cmp byte [0x40ac61], 0
je 0x401240
push dword [ebp - 4]
call fcn.00402711
mov eax, dword [ebp - 4]
pop ecx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x3c]
test eax, eax
jne 0x401435
cmp byte [0x40ac60], al
je 0x401221
mov dword [ebp - 0x18], edi
jmp 0x40124f
cmp byte [0x40ac61], 0
je 0x401240
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push 0x408148
add eax, 0x40
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
pop ecx
pop ecx
cmp dword [ebp - 0x10], edi
jne 0x401257
cmp dword [ebp - 0xc], edi
jne 0x401257
call fcn.00402751
mov dword [ebp - 8], edi
jmp 0x40150a
call fcn.00402d7d
cmp byte [0x40ac62], 0
je 0x4012c8
call fcn.004032b1
sub eax, ebx
sbb edx, dword [ebp - 0x20]
push edx
push eax
call fcn.004032f7
push eax
push 0x40814c
call esi
add esp, 0x10
cmp byte [0x40ac62], 0
je 0x4012c8
mov eax, dword [ebp - 0xc]
test eax, eax
jne 0x401296
mov eax, 0x40ac74
push eax
push 0x408170
call esi
push dword [ebp + 8]
push 0x408184
call esi
add esp, 0x10
cmp dword [ebp + 8], 0
jle 0x4012c8
mov eax, dword [ebp + 0xc]
push dword [eax + edi*4]
push edi
push 0x408198
call esi
add esp, 0xc
inc edi
cmp edi, dword [ebp + 8]
jl 0x4012b1
xor edi, edi
mov dword [ebp - 0x18], 1
cmp dword [ebp - 0x10], edi
je 0x40137b
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.00402257
pop ecx
mov esi, eax
mov eax, dword [ebp - 4]
pop ecx
push eax
mov ecx, dword [eax]
call dword [ecx + 0x3c]
test eax, eax
jne 0x401435
cmp esi, edi
jne 0x401338
mov edi, dword [ebp - 0x10]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, 0x4081b0
mov edx, ecx
mov edi, esi
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
add edx, ecx
push edx
call fcn.0040207c
push dword [ebp - 0x10]
mov dword [ebp - 8], eax
push esi
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
jmp 0x4014fc
mov eax, dword [ebp - 4]
push edi
push esi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x2a4]
cmp eax, edi
mov dword [ebp - 0xc], eax
je 0x401435
push eax
push dword [ebp - 4]
call fcn.004021bd
mov ebx, eax
pop ecx
test ebx, ebx
pop ecx
jne 0x4013fa
push dword [ebp - 4]
call fcn.0040338e
pop ecx
mov dword [ebp - 8], 0x4081e8
jmp 0x40150a
push dword [ebp - 0xc]
push dword [ebp - 4]
call fcn.004020a0
mov esi, eax
pop ecx
cmp esi, edi
pop ecx
jne 0x4013bf
mov edi, dword [ebp - 0xc]
or ecx, 0xffffffff
xor eax, eax
mov esi, 0x40821c
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, esi
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
add edx, ecx
push edx
call fcn.0040207c
push dword [ebp - 0xc]
mov dword [ebp - 8], eax
jmp 0x401328
mov eax, dword [ebp - 4]
push edi
push esi
push eax
mov ecx, dword [eax]
call dword [ecx + 0x2a4]
cmp eax, edi
mov dword [ebp - 0xc], eax
je 0x401435
push eax
push dword [ebp - 4]
call fcn.004021bd
mov ebx, eax
pop ecx
test ebx, ebx
pop ecx
jne 0x4013fa
push dword [ebp - 4]
call fcn.0040338e
pop ecx
mov dword [ebp - 8], 0x40823c
jmp 0x40150a
mov eax, dword [ebp - 4]
push dword [ebp - 0xc]
mov ecx, dword [eax]
push esi
push eax
call dword [ecx + 0x2a8]
mov eax, dword [ebp - 4]
push 0x408270
push 0x408288
push ebx
mov ecx, dword [eax]
push eax
call dword [ecx + 0x1c4]
mov dword [ebp - 0x20], eax
test eax, eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
jne 0x40144f
push eax
call dword [ecx + 0x3c]
test eax, eax
je 0x401443
push dword [ebp - 4]
call fcn.0040338e
pop ecx
jmp 0x40150a
mov dword [ebp - 8], 0x408290
jmp 0x4014fc
push 1
push dword [ebp - 0x20]
push ebx
push eax
call dword [ecx + 0x24]
mov edi, eax
test edi, edi
je 0x401435
mov eax, dword [ebp - 4]
push 0x4082bc
push 0x4082c0
push edi
mov esi, dword [eax]
push eax
call dword [esi + 0x7c]
push eax
push dword [ebp - 4]
call dword [esi + 0x84]
mov esi, eax
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x3c]
test eax, eax
jne 0x401435
mov eax, dword [ebp - 4]
push esi
push edi
push eax
mov ecx, dword [eax]
call dword [ecx + 0xc4]
add esp, 0xc
test al, 1
jne 0x4014aa
mov dword [ebp - 8], 0x4082d0
jmp 0x4014fc
push dword [ebp + 8]
push dword [ebp + 0xc]
push dword [ebp - 4]
call fcn.00402140
add esp, 0xc
test eax, eax
je 0x401435
mov ecx, dword [ebp - 4]
push eax
push dword [ebp - 0x20]
mov edx, dword [ecx]
push ebx
push ecx
call dword [edx + 0x234]
mov eax, dword [ebp - 4]
add esp, 0x10
mov ecx, dword [eax]
push eax
call dword [ecx + 0x3c]
test eax, eax
jne 0x401435
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [eax]
call dword [ecx + 0x14]
test eax, eax
je 0x401502
mov dword [ebp - 8], 0x4082e8
mov byte [ebp - 0x14], 1
jmp 0x40150a
and dword [ebp - 0x18], 0
and dword [ebp - 8], 0
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [eax]
call dword [ecx + 0xc]
cmp dword [ebp - 8], 0
je 0x40152f
cmp dword [0x40ac70], 0
jne 0x40152f
push dword [ebp - 0x14]
push dword [ebp - 8]
call fcn.00403335
pop ecx
pop ecx
mov eax, dword [ebp - 0x18]
pop edi
pop esi
pop ebx
leave
ret