Function at 0x401910
Capabilities:
Read file on windows

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
mov rbp, rcx
mov rcx, qword [rcx]
test rcx, rcx
je 0x401bd0
xor r8d, r8d
xor edx, edx
mov dword [rsp + 0x30], 0
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
lea rbx, [rsp + 0x20]
mov r8d, 2
mov edx, 1
mov rcx, rbx
call sub.msvcrt.dll_fread
cmp byte [rsp + 0x20], 0x4d
jne 0x4019cc
cmp byte [rsp + 0x21], 0x5a
jne 0x4019cc
mov rcx, qword [rbp]
xor r8d, r8d
mov edx, 0x3c
lea r13, [rsp + 0x30]
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 4
mov rcx, r13
mov r8d, 1
call sub.msvcrt.dll_fread
mov eax, dword [rsp + 0x30]
xor r8d, r8d
mov rcx, qword [rbp]
lea edx, [rax + 0x18]
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 2
mov rcx, rbx
mov r8d, 1
call sub.msvcrt.dll_fread
cmp byte [rsp + 0x20], 0xb
je 0x401b70
mov rcx, qword [rbp]
mov r8d, 2
xor edx, edx
call sub.msvcrt.dll_fseek
mov rcx, qword [rbp]
call sub.msvcrt.dll_ftell
mov r12d, eax
mov rcx, qword [rbp]
lea edx, [r12 - 0x60]
xor r8d, r8d
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x401bf0
mov r9, qword [rbp]
lea r13, [rsp + 0x30]
mov r8d, 1
mov edx, 0x60
mov rcx, r13
call sub.msvcrt.dll_fread
test rax, rax
je 0x401bf0
lea rbx, [r13 + 8]
lea r8, str.MEI_f_v_n_v
jmp 0x401a41
sub rbx, 1
cmp rbx, r13
jb 0x401bf0
mov ecx, 8
mov rsi, r8
mov rdi, rbx
repe cmpsb byte [rsi], byte [rdi]
jne 0x401a34
mov rdx, qword [rbx]
mov rcx, qword [rbx + 8]
mov rsi, qword [sym.imp.WS2_32.dll_ntohl]
mov qword [rbp + 0x20], rdx
mov rdx, qword [rbx + 0x10]
mov qword [rbp + 0x28], rcx
mov qword [rbp + 0x30], rdx
mov rdx, qword [rbx + 0x18]
mov qword [rbp + 0x38], rdx
mov rdx, qword [rbx + 0x20]
mov qword [rbp + 0x40], rdx
mov rdx, qword [rbx + 0x28]
mov qword [rbp + 0x48], rdx
mov rdx, qword [rbx + 0x30]
mov qword [rbp + 0x50], rdx
mov rdx, qword [rbx + 0x38]
mov qword [rbp + 0x58], rdx
mov rdx, qword [rbx + 0x40]
mov qword [rbp + 0x60], rdx
mov rdx, qword [rbx + 0x48]
mov qword [rbp + 0x68], rdx
mov rdx, qword [rbx + 0x50]
sub rbx, r13
mov qword [rbp + 0x70], rdx
call rsi
mov ecx, dword [rbp + 0x2c]
mov dword [rbp + 0x407c], 0
sub r12d, eax
lea ebx, [r12 + rbx - 8]
mov dword [rbp + 8], ebx
call rsi
mov rcx, qword [rbp]
xor r8d, r8d
lea edx, [rax + rbx]
call sub.msvcrt.dll_fseek
mov ecx, dword [rbp + 0x30]
call rsi
mov ecx, eax
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [rbp + 0x10], rax
je 0x401c2d
mov rbx, qword [rbp]
mov ecx, dword [rbp + 0x30]
call rsi
mov rcx, qword [rbp + 0x10]
mov r8d, 1
mov edx, eax
mov r9, rbx
call sub.msvcrt.dll_fread
test rax, rax
je 0x401c01
mov rbx, qword [rbp + 0x10]
mov ecx, dword [rbp + 0x30]
call rsi
mov rcx, qword [rbp]
mov eax, eax
add rbx, rax
mov qword [rbp + 0x18], rbx
call sub.msvcrt.dll_ferror
test eax, eax
mov ebx, eax
jne 0x401c17
mov rcx, qword [rbp]
test rcx, rcx
je 0x401b56
call sub.msvcrt.dll_fclose
mov qword [rbp], 0
mov eax, ebx
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
movzx eax, byte [rsp + 0x21]
cmp al, 1
je 0x401bfa
cmp al, 2
jne 0x4019cc
mov edx, 0xa8
add edx, dword [rsp + 0x30]
xor r8d, r8d
mov rcx, qword [rbp]
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 4
mov rcx, r13
mov r8d, 1
call sub.msvcrt.dll_fread
mov r12d, dword [rsp + 0x30]
cmp r12d, 0
je 0x4019cc
jg 0x4019e9
jmp 0x4019cc
lea rcx, [rbp + 0x78]
lea rdx, [0x0040c050]
call fcn.00402e10
test rax, rax
mov rcx, rax
mov qword [rbp], rax
jne 0x40192e
mov ebx, 0xffffffff
jmp 0x401b56
mov edx, 0x98
jmp 0x401b8a
lea rcx, str.Could_not_read_from_file.
mov ebx, 0xffffffff
call fcn.00401e00
jmp 0x401b56
lea rcx, str.Error_on_file
mov ebx, 0xffffffff
call fcn.00401e00
jmp 0x401b56
lea rcx, str.Could_not_allocate_buffer_for_TOC.
mov ebx, 0xffffffff
call fcn.00401e00
jmp 0x401b56