Function at 0x40f6a0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4bcfb8
mov eax, dword fs:[0]
push eax
sub esp, 0x38
push ebx
push esi
mov eax, dword [0x4ea688]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
lea eax, [edi + 0xc8]
push eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor eax, eax
mov dword [ebp - 4], eax
mov dword [edi], 0xffffffff
lea ebx, [edi + 4]
cmp esi, eax
je 0x40f702
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40f6f3
sub eax, edx
sar eax, 1
push eax
push esi
push ebx
call fcn.00425970
mov ecx, dword [edi + 0x80]
mov eax, dword [ecx]
mov dword [ecx], ecx
mov ecx, dword [edi + 0x80]
mov dword [ecx + 4], ecx
mov dword [edi + 0x84], 0
cmp eax, dword [edi + 0x80]
je 0x40f745
nop
mov esi, dword [eax]
push eax
call fcn.00491da6
add esp, 4
mov eax, esi
cmp esi, dword [edi + 0x80]
jne 0x40f730
mov eax, dword [ebx]
cmp dword [eax - 0xc], 0
je 0x40f7ad
xor esi, esi
mov dword [ebp - 0x14], esi
push esi
push 0x80
push 3
push esi
push 7
push SysReAllocString
push eax
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x40f7ca
call fcn.00423a20
test eax, eax
jne 0x40f7e9
push 0
lea edx, [ebp - 0x18]
push edx
push 0x64
lea ebx, [edi + 8]
push ebx
push esi
mov dword [ebp - 0x18], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40f7d1
call fcn.00423a20
test eax, eax
je 0x40f7d7
test esi, esi
je 0x40f7ad
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, eax
mov dword [ebp - 0x14], esi
jmp 0x40f77b
cmp dword [ebp - 0x18], 0x64
jne 0x40f7a2
mov ebx, dword [ebx]
cmp ebx, 1
jge 0x40f806
test esi, esi
je 0x40f7e9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
jne 0x40f890
xor eax, eax
cmp dword [edi + 0xc], eax
je 0x40f86b
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x38], eax
mov eax, esi
lea esi, [ebp - 0x40]
mov byte [ebp - 4], 2
call fcn.00423690
test eax, eax
jne 0x40f863
mov ecx, dword [ebp - 0x3c]
cmp ecx, 0x64
jbe 0x40f863
mov eax, dword [ebp - 0x40]
test eax, eax
je 0x40f863
add ecx, 0xffffff9c
lea edx, [eax + 0x64]
push edi
call fcn.0040f990
test eax, eax
je 0x40f863
mov dword [edi], 2
call fcn.0040f8c0
lea esi, [ebp - 0x14]
call fcn.00423a40
mov edx, dword [ebp - 0x10]
push edx
jmp 0x40f8a2
lea esi, [ebp - 0x40]
call fcn.0040f8c0
lea esi, [ebp - 0x14]
call fcn.00423a40
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea esi, [ebp - 0x14]
mov dword [edi], 1
call fcn.00423a40
mov ecx, dword [ebp - 0x10]
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 esi
pop ebx
mov esp, ebp
pop ebp
ret