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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x599fc0
mov eax, dword fs:[0]
push eax
sub esp, 0x40
mov eax, dword [0x618190]
xor eax, ebp
mov dword [ebp - 0x18], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0xc]
mov ecx, eax
mov ebx, dword [ebp + 8]
push 0
push 0x5ed1da
mov dword [ebp - 0x40], eax
call fcn.0041fab0
mov edi, 1
mov dword [ebp - 4], 0
cmp dword [ebx + 0x14], 8
mov dword [ebp - 0x28], edi
jb 0x4043ce
mov eax, dword [ebx]
jmp 0x4043d0
mov eax, ebx
push 0
push 0x8000027
push 3
push 0
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x48], esi
cmp esi, 0xffffffff
jne 0x40443c
push ecx
mov ecx, ebx
mov dword [ebp - 0x3c], 0x5e9320
mov dword [ebp - 0x38], 0
call fcn.004024f0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
movq xmm0, qword [ebp - 0x3c]
push eax
push esi
push str._tasp::library_CreateFile__s_err_lu.
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 3
call fcn.00404820
add esp, 0x18
xor esi, esi
jmp 0x404582
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x20]
push eax
push 3
lea eax, [ebp - 0x1c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4044a0
push ecx
mov ecx, ebx
mov dword [ebp - 0x3c], 0x5e9390
mov dword [ebp - 0x38], eax
call fcn.004024f0
mov dword [ebp - 0x44], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
movq xmm0, qword [ebp - 0x3c]
push eax
push dword [ebp - 0x44]
push str._tasp::library_ReadFile__s_err_lu.
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 3
call fcn.00404820
add esp, 0x18
mov eax, dword [ebp - 0x20]
cmp eax, 3
jne 0x40450f
cmp byte [ebp - 0x1c], 0xef
jne 0x4044c2
cmp byte [ebp - 0x1b], 0xbb
jne 0x4044c2
cmp byte [ebp - 0x1a], 0xbf
jne 0x4044c2
mov ebx, dword [ebp - 0x24]
add ebx, 0xfffffffd
jmp 0x404526
push ecx
mov ecx, ebx
mov dword [ebp - 0x3c], 0x5e9418
mov dword [ebp - 0x38], 2
call fcn.004024f0
movq xmm0, qword [ebp - 0x3c]
mov ecx, eax
movzx eax, byte [ebp - 0x1a]
push eax
movzx eax, byte [ebp - 0x1b]
push eax
movzx eax, byte [ebp - 0x1c]
push eax
push ecx
push str._tasp::library__s_not_utf8_flag_b00x_x_b10x_x_b20x_x.
sub esp, 0xc
mov eax, esp
movq qword [eax], xmm0
mov dword [eax + 8], 1
call fcn.00404820
mov eax, dword [ebp - 0x20]
add esp, 0x20
mov ebx, dword [ebp - 0x24]
xor edi, edi
mov ecx, dword [ebp - 0x40]
sub ebx, eax
push eax
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x28], edi
push eax
call fcn.0041fcd0
push ebx
call fcn.0043b82a
add esp, 4
mov dword [ebp - 0x24], eax
test eax, eax
je 0x404582
push 0
lea ecx, [ebp - 0x20]
push ecx
push ebx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404568
mov eax, dword [ebp - 0x20]
cmp eax, ebx
mov ebx, dword [ebp - 0x24]
jne 0x40456b
mov ecx, dword [ebp - 0x40]
push eax
push ebx
call fcn.0041fcd0
push ebx
call fcn.0043b833
add esp, 4
jmp 0x404582
mov ebx, dword [ebp - 0x24]
push ebx
call fcn.0043b833
add esp, 4
jmp 0x404582
test esi, esi
je 0x40458d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x18]
xor ecx, ebp
call fcn.00550cb3
mov esp, ebp
pop ebp
ret 0xc