Function at 0x40f240
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, edx
push edi
push esi
mov esi, eax
push ebx
mov ebx, ecx
sub esp, 0x3c
mov eax, dword [esp + 0x68]
test eax, eax
js 0x40f26a
mov eax, dword [esp + 0x68]
or eax, 0x1c
test byte [esp + 0x68], 0x10
cmove eax, dword [esp + 0x68]
mov dword [esp + 0x68], eax
mov eax, dword [0x42b334]
test eax, eax
je 0x40f387
mov eax, dword [eax + 0x3c]
test eax, eax
je 0x40f287
mov eax, dword [eax + 8]
test eax, eax
je 0x40f287
call eax
mov dword [esp + 4], 0
mov dword [esp], 0
call fcn.0040f120
mov edx, dword [0x42b334]
mov eax, dword [edx + 8]
test eax, eax
je 0x40f2e4
mov edi, dword [edx + 0xc]
test edi, edi
jle 0x40f2d6
xor edi, edi
lea esi, [esi]
mov eax, dword [eax + edi*4]
add edi, 1
mov eax, dword [eax - 4]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [0x42b334]
cmp edi, dword [eax + 0xc]
mov eax, dword [eax + 8]
jl 0x40f2b8
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x30]
test eax, eax
je 0x40f2f9
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x2c]
test eax, eax
je 0x40f30e
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x34]
test eax, eax
je 0x40f323
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x38]
test eax, eax
je 0x40f338
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x64]
test eax, eax
je 0x40f34d
mov dword [esp], eax
call sub.msvcrt.dll_free
mov edx, dword [0x42b334]
mov eax, dword [edx + 0x70]
test eax, eax
je 0x40f375
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [0x42b334]
mov eax, dword [eax + 0x7c]
mov dword [esp], eax
call fcn.0041eb50
mov edx, dword [0x42b334]
sub esp, 4
mov dword [esp], edx
call sub.msvcrt.dll_free
mov dword [0x42b334], 0
mov eax, dword [0x42b328]
test eax, eax
je 0x40f3a2
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [0x42b328], 0
test esi, esi
je 0x40f890
test ebp, ebp
je 0x40f890
mov dword [esp + 4], 0x88
mov dword [esp], 1
mov dword [0x42f298], 0x4177c0
mov dword [0x42f29c], 0x417730
mov dword [0x42f2a0], 0x417780
mov dword [0x42f2a4], 0x412b50
mov dword [0x42f2a8], 0x412e00
mov dword [0x42f2ac], 0x418900
mov dword [0x42f2b0], 0x410470
mov dword [0x42f2b4], 0x418970
mov dword [0x42f2b8], 0x418980
mov dword [0x42f2bc], 0x418990
mov dword [0x42f2c0], 0x4189c0
mov dword [0x42f2c4], 0x418610
mov dword [0x42f2c8], 0x4189f0
mov dword [0x42f2cc], 0x418a80
mov dword [0x42f2d0], 0x417c80
mov dword [0x42f2d4], 0x417540
mov dword [0x42f2d8], 0x410090
mov dword [0x42f2dc], 0x4101a0
mov dword [0x42f2e0], 0x410250
mov dword [0x42f2e4], 0x40f050
mov dword [0x42f2e8], 0x417810
mov dword [0x42f2ec], 0x417930
mov dword [0x42f2f0], 0x418c50
mov dword [0x42f2f4], 0x410120
mov dword [0x42f2f8], 0x417800
mov dword [0x42f2fc], 0x417f40
mov dword [0x42f300], 0x417f60
mov dword [0x42f304], 0
call sub.msvcrt.dll_calloc
mov dword [0x42b334], eax
mov edi, eax
test edi, edi
je 0x40f830
mov eax, dword [0x421160]
mov ecx, dword [esp + 0x64]
mov dword [edi + 4], esi
mov dword [edi + 0x18], ebp
lea edx, [eax + 1]
mov dword [edi], eax
mov eax, dword [esp + 0x50]
mov dword [0x421160], edx
mov edx, dword [esp + 0x60]
mov dword [edi + 0x20], eax
mov eax, dword [esp + 0x60]
test edx, edx
mov edx, 0
mov dword [edi + 0x1c], ebx
lea eax, [eax*8 + 0x423160]
cmovs eax, edx
mov dword [edi + 0x44], eax
mov eax, dword [esp + 0x54]
mov dword [edi + 0x48], eax
xor eax, eax
test ecx, ecx
js 0x40f548
mov eax, dword [esp + 0x64]
lea eax, [eax + eax*2]
lea eax, [eax*4 + 0x423180]
fldz
fld dword [esp + 0x6c]
mov dword [edi + 0x54], eax
fucompi st(1)
fstp st(0)
jp 0x40f577
jne 0x40f577
mov dword [esp + 0x28], ebp
fild dword [esp + 0x28]
mov dword [esp + 0x28], ebx
fild dword [esp + 0x28]
fdivrp st(1)
fld qword [str.UUUUUU]
fmulp st(1)
fstp dword [esp + 0x6c]
fld dword [esp + 0x6c]
cmp dword [esp + 0x50], 0x18
fstp dword [edi + 0x60]
je 0x40f900
jg 0x40f855
mov eax, dword [esp + 0x50]
sub eax, 0xf
cmp eax, 1
ja 0x40f860
mov dword [edi + 0x40], 0xffff
mov eax, 2
mov dword [edi + 0x20], 0x10
mov dword [edi + 0x24], eax
imul ebp, eax
mov eax, dword [esp + 0x58]
shl eax, 2
mov dword [edi + 0x28], ebp
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov esi, dword [esp + 0x58]
mov dword [edi + 8], eax
test esi, esi
jle 0x40f61d
mov eax, ebx
xor esi, esi
mov ebx, dword [esp + 0x58]
jmp 0x40f5e6
mov ebp, dword [edi + 0x28]
mov eax, dword [edi + 0x1c]
imul eax, ebp
add eax, 0x12
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov ecx, dword [edi + 8]
lea edx, [eax + 0x12]
and edx, 0xfffffff0
mov dword [ecx + esi*4], edx
add esi, 1
mov dword [edx - 4], eax
mov edi, dword [0x42b334]
cmp ebx, esi
jne 0x40f5e0
mov ecx, dword [edi + 0x48]
mov eax, dword [edi + 8]
mov ebx, dword [edi + 0x1c]
mov dword [esp + 0x54], ecx
imul ebx, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
mov eax, dword [eax]
mov dword [edi + 0xc], ecx
mov dword [edi + 0x14], eax
mov dword [esp + 4], ebx
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov dword [edi + 0x38], eax
mov dword [esp + 4], 0x400
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov dword [edi + 0x30], eax
mov dword [esp + 4], 0x400
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov dword [edi + 0x2c], eax
mov dword [esp], 0x10
call sub.msvcrt.dll_malloc
mov dword [edi + 0x34], eax
mov dword [esp + 4], pe_nt_image_headers32
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov dword [edi + 0x64], eax
mov dword [esp], 0xa00
call sub.msvcrt.dll_malloc
mov dword [edi + 0x70], eax
call fcn.0041eb00
mov dword [edi + 0x7c], eax
mov dword [esp], 0x800
call sub.msvcrt.dll_malloc
cmp dword [esp + 0x68], 0xffffffff
mov dword [0x42b328], eax
mov eax, dword [0x42b334]
je 0x40f70e
test byte [esp + 0x68], 0x40
je 0x40f6df
mov edx, dword [eax + 0x80]
or edx, 8
mov dword [eax + 0x80], edx
test byte [esp + 0x68], 2
je 0x40f6f8
mov edx, dword [eax + 0x80]
or edx, 0x20000000
mov dword [eax + 0x80], edx
test byte [esp + 0x68], 0x80
je 0x40f70e
mov edx, dword [eax + 0x80]
or edx, 0x20
mov dword [eax + 0x80], edx
mov eax, dword [eax + 0x24]
mov dword [esp], eax
call fcn.0040c750
call fcn.00413060
mov ebx, dword [0x42b324]
test ebx, ebx
je 0x40faab
mov esi, dword [0x42b320]
test esi, esi
je 0x40fa7d
cmp dword [esp + 0x68], 0xffffffff
jne 0x40f943
mov dword [esp + 0x68], 0xffffffff
mov ebp, 0x4247e0
lea esi, [esi]
mov eax, dword [0x42b334]
xor esi, esi
mov dword [eax + 0x3c], ebp
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0xffffffff
call fcn.0040ec90
mov eax, dword [0x42b334]
sub esp, 0x10
mov edx, dword [esp + 0x70]
mov dword [eax + 0x58], edx
mov edx, dword [esp + 0x74]
mov dword [eax + 0x5c], edx
call fcn.0040cb00
mov dword [esp + 4], 1
mov dword [esp], eax
mov ebp, eax
mov edi, ebp
call fcn.0040f120
mov edx, dword [esp + 0x58]
mov eax, dword [0x42b334]
test edx, edx
jle 0x40f80d
lea esi, [esi]
mov ecx, dword [eax + 8]
mov edx, dword [eax + 0x1c]
xor ebx, ebx
mov ebp, dword [ecx + esi*4]
test edx, edx
jle 0x40f804
lea esi, [esi]
nop
mov eax, dword [edi + 0x2c]
add ebx, 1
mov dword [esp + 8], eax
mov eax, dword [edi + 0x58]
mov dword [esp], ebp
mov dword [esp + 4], eax
call dword [edi + 0x64]
mov eax, dword [0x42b334]
add ebp, dword [eax + 0x28]
cmp dword [eax + 0x1c], ebx
jg 0x40f7e0
add esi, 1
cmp dword [esp + 0x58], esi
jne 0x40f7c8
call fcn.00408830
mov ebx, dword [0x42b280]
test ebx, ebx
jne 0x40f830
mov dword [0x42b280], 1
mov dword [0x433350], 0x40faf0
cmp dword [esp + 0x68], 0x80000000
jne 0x40f8d0
mov dword [esp], 0
call fcn.004047a0
sub esp, 4
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [esp + 0x50], 0x20
je 0x40f900
movzx ecx, byte [esp + 0x50]
mov eax, 1
shl eax, cl
sub eax, 1
mov dword [edi + 0x40], eax
mov eax, dword [esp + 0x50]
lea edx, [eax + 0xe]
add eax, 7
cmovs eax, edx
sar eax, 3
jmp 0x40f5b2
mov edx, 0x42f298
xor eax, eax
mov ecx, 0x1c
cmp dword [esp + 0x68], 0x80000000
mov edi, edx
rep stosd dword es:[edi], eax
jne 0x40f918
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0xffffffff
call fcn.004059a0
mov edi, dword [0x42b334]
jmp 0x40f4e5
mov ecx, dword [0x42b334]
xor eax, eax
mov dword [esp + 4], 0
mov dword [esp], 0
test ecx, ecx
setne al
mov dword [esp + 8], eax
call fcn.0041e4a0
jmp 0x40f83e
mov dword [edi + 0x40], 0xffffffff
mov eax, 4
mov dword [edi + 0x20], 0x20
jmp 0x40f5b2
mov dword [esp + 4], 0x19
mov dword [esp], 0x50
call fcn.0041db50
sub esp, 8
mov dword [esp], 0
call fcn.0041da20
sub esp, 4
jmp 0x40f8aa
mov dword [esp + 4], str.null
mov dword [esp], esi
call dword [sym.imp.msvcrt.dll__stricmp]
test eax, eax
je 0x40fa0b
mov dword [esp + 0x2c], 4
mov edi, dword [esp + 0x68]
lea esi, [esi]
nop
mov eax, dword [esp + 0x2c]
mov ebp, dword [0x421170]
xor ebx, ebx
and eax, 1
mov dword [esp + 0x28], eax
test ebp, ebp
jne 0x40f9e9
jmp 0x40fa18
mov eax, dword [0x42b334]
test bl, 1
mov edx, 0
cmove edx, dword [esp + 0x5c]
mov ecx, dword [ebp + 4]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], edx
mov edx, dword [eax + 0x20]
mov dword [esp + 0xc], edx
mov edx, dword [eax + 0x1c]
imul edx, dword [eax + 0x48]
mov dword [esp + 8], edx
mov eax, dword [eax + 0x18]
mov dword [esp + 4], eax
mov eax, dword [0x42b324]
mov dword [esp], eax
call ecx
test eax, eax
je 0x40fa40
call dword [ebp + 8]
add ebx, 1
mov eax, ebx
sar eax, 1
mov ebp, dword [eax*4 + 0x421170]
test ebp, ebp
je 0x40fa18
test esi, esi
je 0x40f990
mov ecx, dword [esp + 0x28]
test ecx, ecx
jne 0x40f990
mov eax, dword [ebp]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.msvcrt.dll__stricmp]
test eax, eax
je 0x40f990
jmp 0x40f9d7
mov ebp, 0x4247e0
jmp 0x40f758
mov eax, dword [esp + 0x2c]
sub eax, 1
test esi, esi
je 0x40fa50
cmp dword [esp + 0x2c], 3
je 0x40fa78
test eax, eax
je 0x40fa57
mov dword [esp + 0x2c], eax
jmp 0x40f970
mov dword [esp + 0x68], edi
jmp 0x40f758
xor edi, 1
test eax, eax
jne 0x40fa2e
call fcn.0040faf0
mov dword [esp], 1
call fcn.004047a0
sub esp, 4
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
xor edi, 1
jmp 0x40fa2e
mov dword [esp], str.FBGFX
call sub.msvcrt.dll_getenv
cmp dword [esp + 0x68], 0xffffffff
mov esi, eax
je 0x40f745
test eax, eax
jne 0x40f943
mov dword [esp + 0x2c], 2
jmp 0x40f964
mov dword [esp + 4], 0x7f
mov dword [esp], 0x42b2a0
call fcn.0041eab0
mov dword [esp + 4], 0x2e
mov dword [esp], eax
mov dword [0x42b324], eax
call sub.msvcrt.dll_strrchr
test eax, eax
je 0x40f72c
mov byte [eax], 0
jmp 0x40f72c