Function at 0x401620
Capabilities:
Get file size
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x419ab8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
mov ebx, ecx
push ebp
push esi
mov eax, dword [ebx + 4]
xor esi, esi
cmp eax, esi
push edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], esi
jne 0x401664
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
push esi
push esi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx + 4]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 4
mov dword [esp + 0x20], edi
jae 0x401699
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
mov eax, dword [ebx + 4]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x14]
push esi
push ecx
lea edx, [esp + 0x18]
push 4
push edx
push eax
call ebp
test eax, eax
jne 0x4016c9
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
mov eax, dword [esp + 0x10]
lea eax, [eax + eax*2]
shl eax, 4
add eax, 4
cmp edi, eax
jae 0x4016ef
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
lea eax, [ebx + 0x128]
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2c], esi
cmp eax, esi
mov dword [esp + 0x1c], esi
jle 0x401769
push 0x30
call fcn.00412261
mov esi, eax
mov ecx, 0xc
xor eax, eax
mov edi, esi
add esp, 4
rep stosd dword es:[edi], eax
mov edx, dword [ebx + 4]
lea ecx, [esp + 0x14]
push eax
push ecx
push 0x30
push esi
push edx
call ebp
cmp dword [esp + 0x14], 0x30
jne 0x4017bb
mov eax, dword [esi + 0x10]
mov edx, dword [esi + 4]
mov ecx, dword [esp + 0x20]
add eax, edx
cmp eax, ecx
jg 0x401756
push esi
lea ecx, [ebx + 8]
call fcn.00411f19
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x10]
inc eax
cmp eax, ecx
mov dword [esp + 0x1c], eax
jl 0x401710
xor esi, esi
mov edi, dword [ebx + 0xc]
cmp edi, esi
je 0x401804
mov eax, edi
mov edi, dword [edi]
mov esi, dword [eax + 8]
mov edx, dword [esi + 4]
push edx
call fcn.00412261
add esp, 4
mov dword [esi + 0x14], eax
mov eax, dword [esi + 0x10]
mov ecx, dword [ebx + 4]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x14]
lea edx, [esp + 0x14]
push 0
push edx
mov edx, dword [ebx + 4]
push eax
push ecx
push edx
call ebp
test eax, eax
je 0x4017e4
test edi, edi
jne 0x401774
jmp 0x401804
push esi
call fcn.0041228a
mov ecx, dword [esp + 0x1c]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x24]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x20
ret