Function at 0x4080f0
Capabilities:
Check if file exists
Get file size
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x416cbb
mov eax, dword fs:[0]
push eax
sub esp, 0x828
mov eax, dword [0x41e028]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor esi, esi
mov dword [ebp - 0x828], esi
mov dword [ebp - 0x82c], esi
mov dword [ebp - 0x830], esi
mov edx, dword [ebp + 8]
push 0x2710
push esi
lea eax, [ebp - 0x824]
push eax
lea ecx, [ebp - 0x830]
push ecx
mov dword [ebp - 4], esi
push edx
mov dword [ebp - 0x824], esi
call fcn.00406640
test eax, eax
je 0x408177
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x830]
cmp eax, esi
je 0x408372
push eax
jmp 0x40836a
mov ecx, dword [ebp - 0x824]
cmp ecx, 0x10
jb 0x40815c
mov edi, dword [ebp - 0x830]
mov edx, dword [edi + 8]
xor eax, eax
mov dword [ebp - 0x81c], eax
mov dword [ebp - 0x818], eax
mov eax, dword [edi + 0xc]
lea edx, [edx + eax + 0x10]
cmp edx, ecx
jne 0x408336
cmp eax, esi
je 0x408336
mov byte [edi + eax + 0xf], 0
mov ecx, dword [edi + 0xc]
lea ebx, [edi + 0x10]
mov byte [ebx + ecx - 2], 0
mov edx, dword [edi + 0xc]
lea eax, [edi + edx + 0x10]
push 0x7fe
lea edx, [ebp - 0x812]
xor ecx, ecx
push esi
push edx
mov dword [ebp - 0x824], eax
mov word [ebp - 0x814], cx
call fcn.0040e850
add esp, 0xc
push 0x400
lea eax, [ebp - 0x814]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x408217
push ebx
lea ecx, [ebp - 0x814]
push 0x400
push ecx
call fcn.0040a937
add esp, 0xc
push esi
push esi
push 3
push esi
push 3
push 0x80000000
lea edx, [ebp - 0x814]
push edx
or ebx, 0xffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40824c
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
cmp ebx, 0xffffffff
jne 0x408285
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x408264
xor ebx, ebx
xor eax, eax
jmp 0x408287
mov dword [ebp - 0x820], 1
mov dword [ebp - 0x81c], eax
mov dword [ebp - 0x818], 0
xor esi, esi
jmp 0x40834c
xor ebx, ebx
mov ecx, dword [edi + 4]
cmp eax, ecx
je 0x4082a7
mov dword [ebp - 0x820], ebx
mov dword [ebp - 0x81c], ebx
mov dword [ebp - 0x818], eax
xor esi, esi
jmp 0x40834c
mov eax, dword [edi + 8]
push eax
push ecx
mov ecx, dword [ebp - 0x824]
push ecx
lea ecx, [ebp - 0x814]
call fcn.00401be0
add esp, 0xc
cmp eax, 0xffffffff
je 0x4082fe
push ebx
push ebx
push 3
push ebx
push 3
push 0x80000000
lea edx, [ebp - 0x814]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4082fe
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push esi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, 0xffffffff
jne 0x40831e
xor ebx, ebx
mov dword [ebp - 0x820], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x81c], eax
mov dword [ebp - 0x818], ebx
xor esi, esi
jmp 0x40834c
xor eax, eax
mov dword [ebp - 0x820], eax
mov dword [ebp - 0x81c], eax
mov dword [ebp - 0x818], ebx
xor esi, esi
jmp 0x40834c
mov dword [ebp - 0x820], 2
mov dword [ebp - 0x81c], esi
mov dword [ebp - 0x818], esi
mov ecx, dword [ebp + 8]
push esi
lea eax, [ebp - 0x820]
push eax
push ecx
mov eax, 0xc
call fcn.00406860
mov dword [ebp - 4], 0xffffffff
push edi
call fcn.00409587
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.0040942c
mov esp, ebp
pop ebp
ret