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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53b806
mov eax, dword fs:[0]
push eax
sub esp, 0x10
push ebx
push esi
push edi
mov eax, dword [0x59a0a0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push dword [ebp + 8]
lea ecx, [ebp - 0x10]
xor edi, edi
call fcn.00401ff0
mov dword [ebp - 4], edi
or ebx, 0xffffffff
mov eax, dword [ebp - 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [eax - 0xc], edi
jbe 0x509f38
push 0x5698bc
lea ecx, [ebp - 0x18]
call fcn.00401ff0
mov esi, eax
push 1
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 1
push eax
lea ecx, [ebp - 0x10]
call fcn.004032e0
mov edx, esi
mov ecx, eax
call fcn.0042aad0
mov edx, dword [ebp - 0x14]
mov ecx, ebx
mov byte [ebp + 0xb], al
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x509ede
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x509edc
mov eax, dword [ecx + 4]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
push dword [eax + 4]
call esi
jmp 0x509ee4
call esi
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 0
mov eax, ebx
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x509f23
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
mov dword [ebp - 0x1c], esi
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x509f1e
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call esi
jmp 0x509f23
mov ecx, edx
call dword [ebp - 0x1c]
cmp byte [ebp + 0xb], 0
je 0x509f38
push 1
push 0x56975c
lea ecx, [ebp - 0x10]
call fcn.00402320
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x509fe2
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x10]
lea ecx, [ebp + 8]
push dword [eax + edi*4]
call fcn.00401d60
add esp, 4
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ecx, dword [ebp + 8]
add ecx, 0xfffffff0
cmp eax, 0xffffffff
mov eax, ebx
je 0x509fac
inc edi
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x509fa3
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x509f99
mov eax, dword [edx + 4]
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push 0
push dword [eax + 4]
call esi
jmp 0x509fa3
mov ecx, edx
call esi
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [ebp + 0x10]
cmp edi, eax
jb 0x509f43
jmp 0x509fe2
lock xadd dword [ecx + 0xc], eax
dec eax
test eax, eax
jg 0x509fdf
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
mov dword [ebp + 0xc], esi
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x509fda
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call esi
jmp 0x509fdf
mov ecx, edx
call dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
cmp edi, eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x10]
mov ecx, 1
mov edi, 0
cmove edi, ecx
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x50a028
mov edx, dword [eax]
push eax
mov ecx, dword [edx]
mov ebx, dword [ecx + 4]
cmp ecx, vtable.ATL::CAtlStringMgr.0
jne 0x50a024
mov ecx, dword [edx + 4]
push 0
push dword [ecx + 4]
call esi
jmp 0x50a028
mov ecx, edx
call ebx
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc