Function at 0x40f3a0
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52eec8
mov eax, dword fs:[0]
push eax
sub esp, 8
push ebx
push esi
push edi
mov eax, dword [0x58abb4]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
or esi, 0xffffffff
test edi, edi
je 0x40f70b
mov eax, edi
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40f3e0
sub eax, edx
sar eax, 1
je 0x40f70b
push 0x53f9c0
lea ecx, [ebp - 0x10]
call fcn.00404630
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx - 0xc]
mov dword [ebp - 4], 0
test eax, eax
je 0x40f434
push eax
push edi
push ecx
call fcn.0051247b
add esp, 0xc
test eax, eax
jne 0x40f434
push edi
mov ecx, ebx
call fcn.00401df0
mov esi, 0x80
jmp 0x40f6e0
push edi
lea ecx, [ebp + 8]
call fcn.00404630
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
mov byte [ebp - 4], 1
jle 0x40f469
push 0x3a
push eax
call fcn.00510bc0
add esp, 8
test eax, eax
je 0x40f469
mov ecx, dword [ebp + 8]
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
jne 0x40f6a4
mov eax, dword [ebp + 8]
cmp dword [eax - 0xc], 0
jl 0x40f494
push 0x53f9b8
push eax
call fcn.00510b60
add esp, 8
test eax, eax
je 0x40f494
mov ecx, dword [ebp + 8]
sub eax, ecx
sar eax, 1
cmp eax, 0xffffffff
jne 0x40f6a4
mov eax, dword [0x58c2a4]
mov eax, dword [eax - 0xc]
test eax, eax
je 0x40f4d0
push 0x58c2a4
lea ecx, [ebp + 8]
call fcn.00401b60
push edi
lea ecx, [ebp + 8]
call fcn.00402090
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f4d0
lea edx, [ebp + 8]
push edx
jmp 0x40f6b6
mov eax, dword [0x58c270]
cmp dword [eax - 0xc], 0
je 0x40f50d
push 0x58c270
lea ecx, [ebp + 8]
call fcn.00401b60
push edi
lea ecx, [ebp + 8]
call fcn.00402090
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f516
lea edx, [ebp + 8]
push edx
mov ecx, ebx
call fcn.00401b60
cmp esi, 0xffffffff
jne 0x40f6bd
mov eax, dword [0x58c2c0]
cmp dword [eax - 0xc], 0
je 0x40f553
push 0x58c2c0
lea ecx, [ebp + 8]
call fcn.00401b60
push edi
lea ecx, [ebp + 8]
call fcn.00402090
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f55c
lea edx, [ebp + 8]
push edx
mov ecx, ebx
call fcn.00401b60
cmp esi, 0xffffffff
jne 0x40f6bd
mov eax, dword [0x58c240]
mov eax, dword [eax - 0xc]
test eax, eax
je 0x40f59a
push 0x58c240
lea ecx, [ebp + 8]
call fcn.00401b60
push edi
lea ecx, [ebp + 8]
call fcn.00402090
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f5a3
lea edx, [ebp + 8]
push edx
mov ecx, ebx
call fcn.00401b60
cmp esi, 0xffffffff
jne 0x40f6bd
push edi
mov ecx, ebx
call fcn.00401df0
push 0x5c
mov ecx, ebx
call fcn.004032b0
cmp eax, 0xffffffff
je 0x40f6bd
mov ecx, dword [ebx]
mov ecx, dword [ecx - 0xc]
sub ecx, eax
push ecx
lea edx, [ebp - 0x14]
push edx
mov ecx, ebx
call fcn.00406f00
push eax
mov ecx, ebx
mov byte [ebp - 4], 2
call fcn.00401b60
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.00401350
mov eax, dword [0x58c2a4]
cmp dword [eax - 0xc], 0
je 0x40f657
push 0x58c2a4
lea ecx, [ebp + 8]
call fcn.00401b60
mov edx, dword [ebp + 8]
mov ecx, dword [edx - 0xc]
lea eax, [ecx - 1]
test eax, eax
js 0x40f69a
cmp eax, ecx
jg 0x40f69a
cmp word [edx + eax*2], 0x5c
jne 0x40f62c
dec ecx
push 1
push ecx
lea ecx, [ebp + 8]
call fcn.00406620
mov eax, dword [ebx]
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp + 8]
call fcn.00401a70
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f65c
lea edx, [ebp + 8]
push edx
mov ecx, ebx
call fcn.00401b60
cmp esi, 0xffffffff
jne 0x40f6bd
mov eax, dword [0x58c240]
cmp dword [eax - 0xc], 0
je 0x40f6bd
push 0x58c240
lea ecx, [ebp + 8]
call fcn.00401b60
mov eax, dword [ebx]
mov ecx, dword [eax - 0xc]
push ecx
push eax
lea ecx, [ebp + 8]
call fcn.00401a70
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f6bd
lea edx, [ebp + 8]
push edx
jmp 0x40f6b6
push 0x80070057
call fcn.00401090
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40f6bd
lea eax, [ebp + 8]
push eax
mov ecx, ebx
call fcn.00401b60
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
mov byte [ebp - 4], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f6e0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f706
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp esi, 0xffffffff
jne 0x40f72d
push 0
push 0x53eb18
mov ecx, ebx
call fcn.00401900
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret