Function at 0x41f490
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x46e79a
mov eax, dword fs:[0]
push eax
sub esp, 0x4f4
mov eax, dword [0x491120]
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
mov dword [ebp - 0x10], esp
push 0xe
xor esi, esi
push 0x474b0c
mov ecx, 0x492804
mov dword [ebp - 4], esi
call fcn.004031f0
mov ecx, dword [ebp + 8]
push 0x104
lea eax, [ebp - 0x21c]
push eax
push ecx
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
xor edx, edx
lea eax, [ebp - 0x21c]
mov word [ebp - 0x434], dx
mov dword [ebp - 0x420], 7
mov dword [ebp - 0x424], esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x41f513
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x438]
call fcn.004072d0
mov edx, dword [ebp - 0x420]
mov ecx, dword [ebp - 0x434]
mov byte [ebp - 4], 2
mov eax, ecx
cmp edx, 8
jae 0x41f552
lea eax, [ebp - 0x434]
mov edi, dword [ebp - 0x424]
lea ebx, [eax + edi*2]
cmp ebx, esi
je 0x41f584
mov eax, ecx
cmp edx, 8
jae 0x41f56c
lea eax, [ebp - 0x434]
cmp eax, ebx
ja 0x41f584
mov eax, ecx
cmp edx, 8
jae 0x41f57d
lea eax, [ebp - 0x434]
lea eax, [eax + edi*2]
cmp ebx, eax
jbe 0x41f59b
call fcn.0044e158
mov edx, dword [ebp - 0x420]
mov edi, dword [ebp - 0x424]
mov ecx, dword [ebp - 0x434]
cmp edx, 8
jb 0x41f6d4
mov esi, ecx
test ecx, ecx
je 0x41f5cf
mov eax, ecx
cmp edx, 8
jae 0x41f5b7
lea eax, [ebp - 0x434]
cmp eax, esi
ja 0x41f5cf
mov eax, ecx
cmp edx, 8
jae 0x41f5c8
lea eax, [ebp - 0x434]
lea ecx, [eax + edi*2]
cmp esi, ecx
jbe 0x41f5d4
call fcn.0044e158
mov edx, dword [ebp - 0x458]
push edx
lea eax, [ebp - 0x438]
push ebx
mov ecx, eax
push ecx
push esi
mov edi, 0xf
push eax
lea ecx, [ebp - 0x454]
mov dword [ebp - 0x43c], edi
mov dword [ebp - 0x440], 0
mov byte [ebp - 0x450], 0
call fcn.0041d570
mov eax, dword [ebp - 0x450]
mov ebx, 0x10
cmp dword [ebp - 0x43c], ebx
jae 0x41f627
lea eax, [ebp - 0x450]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x41f6df
cmp dword [ebp - 0x43c], ebx
jb 0x41f64e
mov eax, dword [ebp - 0x450]
push eax
call fcn.0042a4ff
add esp, 4
xor esi, esi
cmp dword [ebp - 0x420], 8
mov dword [ebp - 0x43c], edi
mov dword [ebp - 0x440], esi
mov byte [ebp - 0x450], 0
jb 0x41f67b
mov ecx, dword [ebp - 0x434]
push ecx
call fcn.0042a4ff
add esp, 4
xor edx, edx
mov dword [ebp - 0x420], 7
mov dword [ebp - 0x424], esi
mov word [ebp - 0x434], dx
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
or edx, 0xffffffff
lea ecx, [eax + 0xc]
mov dword [ebp - 4], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41f6b6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor al, al
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.0044dfec
mov esp, ebp
pop ebp
ret
lea esi, [ebp - 0x434]
jmp 0x41f5aa
test bl, al
je 0x41f771
cmp dword [ebp - 0x43c], ebx
jb 0x41f6fe
mov ecx, dword [ebp - 0x450]
push ecx
call fcn.0042a4ff
add esp, 4
xor esi, esi
cmp dword [ebp - 0x420], 8
mov dword [ebp - 0x43c], edi
mov dword [ebp - 0x440], esi
mov byte [ebp - 0x450], 0
jb 0x41f72b
mov edx, dword [ebp - 0x434]
push edx
call fcn.0042a4ff
add esp, 4
xor eax, eax
mov word [ebp - 0x434], ax
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov dword [ebp - 0x420], 7
mov dword [ebp - 0x424], esi
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41f76a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov al, 1
jmp 0x41f6b8
cmp dword [ebp - 0x43c], ebx
jb 0x41f788
mov ecx, dword [ebp - 0x450]
push ecx
call fcn.0042a4ff
add esp, 4
cmp dword [ebp - 0x420], 8
mov dword [ebp - 0x43c], edi
mov dword [ebp - 0x440], 0
mov byte [ebp - 0x450], 0
jb 0x41f694
mov edx, dword [ebp - 0x434]
push edx
call fcn.0042a4ff
add esp, 4
jmp 0x41f694