Function at 0x40e7d0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4bec01
mov eax, dword fs:[0]
push eax
mov eax, 0x1888
call fcn.004a87d0
mov eax, dword [0x4ea688]
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.004982c0
add esp, 0xc
cmp dword [ebx], 0
mov byte [ebp - 0x1874], 0x62
jne 0x40e848
push 0
call fcn.00494daa
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 0x40e870
sub eax, edx
sar eax, 1
lea esi, [eax + eax]
mov dword [ebp - 0x1867], esi
test esi, esi
je 0x40e8a2
push esi
lea ecx, [ebp - 0x1863]
push edi
push ecx
call fcn.00499f30
add esp, 0xc
lea eax, [esi + 4]
jmp 0x40e8a7
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 0x40e8b6
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e8e1
push edi
push edx
push eax
call fcn.00499f30
add esp, 0xc
add edi, 4
jmp 0x40e8e6
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 0x40e8f3
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e91e
push edi
push edx
push eax
call fcn.00499f30
add esp, 0xc
add edi, 4
jmp 0x40e923
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 0x40e956
cmp eax, esi
jne 0x40e989
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 0x40e990
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40eb58
xor edi, edi
mov dword [ebp - 0x187c], edi
mov byte [ebp - 4], 1
call fcn.00423730
test eax, eax
je 0x40e9ea
cmp eax, 0xffffffff
je 0x40e9ea
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 0x40ea43
mov esi, dword [ebp - 0x188c]
mov eax, dword [esi]
mov dword [ebp - 0x1884], edi
cmp eax, 0xffffffff
je 0x40ea62
push 0
push 0
push eax
jmp 0x40ea6b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40ea26
mov esi, ebx
call fcn.0040e230
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 0x40e9aa
call fcn.00423a20
test eax, eax
je 0x40e9b2
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 0x40eb58
test edi, edi
je 0x40ea4e
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 0x40eb58
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 0x40eab3
mov eax, ebx
call fcn.0040e380
cmp edi, 0xffffffff
je 0x40ea94
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x40ea9f
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 0x40eb58
mov ecx, dword [ebp - 0x1890]
lea eax, [ebp - 0x187c]
push eax
lea edx, [ebp - 0x1878]
call fcn.004237e0
test eax, eax
je 0x40eafd
mov eax, ebx
call fcn.0040e380
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423a40
mov ecx, dword [ebp - 0x1880]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40eb58
push 0
push 0
push 4
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40eb23
lea eax, [ebp - 0x187c]
lea edx, [ebx + 0x28]
push eax
mov ecx, 8
call fcn.004237e0
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x40eb33
call fcn.00423a20
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423a40
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.00491db1
mov esp, ebp
pop ebp
ret 0xc