Function at 0x40e2b0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4bdfb1
mov eax, dword fs:[0]
push eax
mov eax, 0x188c
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 0x40e328
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 0x40e350
sub eax, edx
sar eax, 1
lea esi, [eax + eax]
mov dword [ebp - 0x1867], esi
test esi, esi
je 0x40e382
push esi
lea ecx, [ebp - 0x1863]
push edi
push ecx
call fcn.004993f0
add esp, 0xc
lea eax, [esi + 4]
jmp 0x40e387
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 0x40e396
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e3c1
push edi
push edx
push eax
call fcn.004993f0
add esp, 0xc
add edi, 4
jmp 0x40e3c6
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 0x40e3d3
sub eax, edi
sar eax, 1
lea edi, [eax + eax]
mov dword [esi], edi
lea eax, [esi + 4]
test edi, edi
je 0x40e3fe
push edi
push edx
push eax
call fcn.004993f0
add esp, 0xc
add edi, 4
jmp 0x40e403
mov edi, 4
mov edx, dword [ebx + 0x184c]
mov ebx, dword [ebp - 0x1884]
add esi, edi
mov dword [esi], edx
add esi, 4
mov byte [esi], 0x65
inc esi
lea eax, [ebp - 0x1878]
sub esi, eax
lea edi, [ebx + 4]
mov dword [ebp - 0x1890], esi
add esi, 0xfffffffc
push edi
mov dword [ebp - 0x1878], esi
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 0x40e465
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e62d
xor edi, edi
mov dword [ebp - 0x187c], edi
mov byte [ebp - 4], 1
call fcn.00422dd0
test eax, eax
je 0x40e4bf
cmp eax, 0xffffffff
je 0x40e4bf
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 0x40e518
mov esi, dword [ebp - 0x188c]
mov eax, dword [esi]
mov dword [ebp - 0x1884], edi
cmp eax, 0xffffffff
je 0x40e537
push 0
push 0
push eax
jmp 0x40e540
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40e4fb
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 0x40e47f
call fcn.004230e0
test eax, eax
je 0x40e487
mov edx, dword [ebp - 0x1880]
mov ecx, dword [ebp - 0x1888]
push edx
mov byte [ecx], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e62d
test edi, edi
je 0x40e523
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1880]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e62d
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 0x40e588
mov eax, ebx
call fcn.0040dab0
cmp edi, 0xffffffff
je 0x40e569
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x40e574
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 0x40e62d
mov ecx, dword [ebp - 0x1890]
lea edx, [ebp - 0x187c]
push edx
lea edx, [ebp - 0x1878]
call fcn.00422e80
test eax, eax
je 0x40e5d2
mov eax, ebx
call fcn.0040dab0
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423100
mov eax, dword [ebp - 0x1880]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40e62d
push 0
push 0
push 4
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40e5f8
lea ecx, [ebp - 0x187c]
push ecx
lea edx, [ebx + 0x28]
mov ecx, 8
call fcn.00422e80
push edi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x40e608
call fcn.004230e0
lea eax, [ebp - 0x1884]
call fcn.00401bd0
lea esi, [ebp - 0x187c]
call fcn.00423100
mov edx, dword [ebp - 0x1880]
push edx
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 8