Function at 0x40df00
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4be001
mov eax, dword fs:[0]
push eax
mov eax, 0x1888
call fcn.004a7ca0
mov eax, dword [0x4e9688]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov ebx, dword [ebp + 0xc]
push 0x1862
mov dword [ebp - 0x1884], eax
lea eax, [ebp - 0x1878]
push 0
push eax
mov dword [ebp - 0x188c], ecx
mov dword [ebp - 0x1888], edx
call fcn.00497780
add esp, 0xc
cmp dword [ebx], 0
mov byte [ebp - 0x1874], 0x62
jne 0x40df78
push 0
call fcn.00494269
add esp, 4
mov dword [ebx], eax
mov eax, dword [ebx + 8]
mov edx, dword [ebx + 4]
mov ecx, dword [ebx]
lea edi, [ebx + 0xc]
mov dword [ebp - 0x186b], eax
mov eax, edi
mov dword [ebp - 0x186f], edx
mov dword [ebp - 0x1873], ecx
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40dfa0
sub eax, edx
sar eax, 1
lea esi, [eax + eax]
mov dword [ebp - 0x1867], esi
test esi, esi
je 0x40dfd2
push esi
lea ecx, [ebp - 0x1863]
push edi
push ecx
call fcn.004993f0
add esp, 0xc
lea eax, [esi + 4]
jmp 0x40dfd7
mov eax, 4
lea edx, [ebx + 0x4c]
lea esi, [ebp + eax - 0x1867]
mov eax, edx
lea edi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40dfe6
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e011
push edi
push edx
push eax
call fcn.004993f0
add esp, 0xc
add edi, 4
jmp 0x40e016
mov edi, 4
lea edx, [ebx + 0x84c]
mov eax, edx
add esi, edi
lea edi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40e023
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e04e
push edi
push edx
push eax
call fcn.004993f0
add esp, 0xc
add edi, 4
jmp 0x40e053
mov edi, 4
mov edx, dword [ebx + 0x184c]
add esi, edi
mov dword [esi], edx
add esi, 4
mov byte [esi], 0x65
inc esi
lea eax, [ebp - 0x1878]
sub esi, eax
mov eax, dword [ebp + 0x10]
lea ecx, [esi - 4]
mov dword [ebp - 0x1890], esi
mov dword [ebp - 0x1878], ecx
test eax, eax
je 0x40e086
cmp eax, esi
jne 0x40e0b9
mov ebx, dword [ebp - 0x1884]
lea edi, [ebx + 4]
push edi
mov dword [ebp - 0x1880], edi
mov dword [ebp - 0x1894], edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
mov esi, dword [ebx + 0x20]
cmp dword [esi - 0xc], 0
jne 0x40e0c0
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e288
xor edi, edi
mov dword [ebp - 0x187c], edi
mov byte [ebp - 4], 1
call fcn.00422dd0
test eax, eax
je 0x40e11a
cmp eax, 0xffffffff
je 0x40e11a
mov edi, eax
mov dword [ebp - 0x187c], edi
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push 0
push edi
mov byte [ebp - 4], 2
call dword [sym.imp.KERNEL32.dll_LockFile]
test eax, eax
je 0x40e173
mov esi, dword [ebp - 0x188c]
mov eax, dword [esi]
mov dword [ebp - 0x1884], edi
cmp eax, 0xffffffff
je 0x40e192
push 0
push 0
push eax
jmp 0x40e19b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40e156
mov esi, ebx
call fcn.0040d960
mov eax, dword [ebx + 0x20]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x40e0da
call fcn.004230e0
test eax, eax
je 0x40e0e2
mov eax, dword [ebp - 0x1880]
mov edx, dword [ebp - 0x1888]
push eax
mov byte [edx], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e288
test edi, edi
je 0x40e17e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1880]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e288
inc dword [ebx + 0x28]
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x40e1e3
mov eax, ebx
call fcn.0040dab0
cmp edi, 0xffffffff
je 0x40e1c4
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x40e1cf
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x1880]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e288
mov ecx, dword [ebp - 0x1890]
lea eax, [ebp - 0x187c]
push eax
lea edx, [ebp - 0x1878]
call fcn.00422e80
test eax, eax
je 0x40e22d
mov eax, ebx
call fcn.0040dab0
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423100
mov ecx, dword [ebp - 0x1880]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e288
push 0
push 0
push 4
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40e253
lea eax, [ebp - 0x187c]
lea edx, [ebx + 0x28]
push eax
mov ecx, 8
call fcn.00422e80
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x40e263
call fcn.004230e0
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423100
mov ecx, dword [ebp - 0x1880]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00491281
mov esp, ebp
pop ebp
ret 0xc