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

Disassembly:
mov rax, rsp
push r13
push r14
push r15
sub rsp, 0xa0
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r12
mov r14, r9
mov rbx, r8
mov rdi, rdx
xor r15d, r15d
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], r15d
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x80000000
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
cmp rax, 0xffffffffffffffff
jne 0x140031410
call fcn.140004490
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov r8, rdi
lea rdx, str.failed_1__file___S__err:__d
mov rcx, rbx
call fcn.140004510
mov dword [rsp + 0x44], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x44]
call sub.MSVCR90.dll__CxxThrowException
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp eax, 0xffffffff
jne 0x14003145e
call fcn.140004490
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov r8, rdi
lea rdx, str.failed_2__file___S__err:__d
mov rcx, rbx
call fcn.140004510
mov dword [rsp + 0x60], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x60]
call sub.MSVCR90.dll__CxxThrowException
mov rdx, rsi
mov ecx, 2
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov r13, rax
test rax, rax
jne 0x1400314b0
call fcn.140004490
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov r8, rdi
lea rdx, str.failed_3__file___S__err:__d
mov rcx, rbx
call fcn.140004510
mov dword [rsp + 0x4c], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x4c]
call sub.MSVCR90.dll__CxxThrowException
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GlobalLock]
test rax, rax
jne 0x1400314d7
mov dword [rsp + 0x68], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x68]
call sub.MSVCR90.dll__CxxThrowException
mov dword [rsp + 0x54], r15d
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x54]
mov r8d, esi
mov rdx, rax
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140031512
mov dword [rsp + 0x64], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x64]
call sub.MSVCR90.dll__CxxThrowException
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsp + 0x58], r15
lea r8, [rsp + 0x58]
mov edx, 1
mov rcx, r13
call qword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
test eax, eax
js 0x14003161b
mov rcx, qword [rsp + 0x58]
test rcx, rcx
je 0x14003161b
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
lea r9, [0x14008abb8]
xor r8d, r8d
mov edx, esi
call qword [sym.imp.OLEAUT32.dll_OleCreatePictureIndirect]
mov esi, eax
test eax, eax
js 0x1400315db
cmp qword [rsp + 0x70], r15
je 0x1400315db
mov rcx, qword [rsp + 0x58]
mov rax, qword [rcx]
call qword [rax + 0x10]
mov rcx, qword [rsp + 0x70]
mov rax, qword [rcx]
lea rdx, [rsp + 0x40]
call qword [rax + 0x18]
mov rcx, rbx
call sub.mfc90u.dll_DDX_FieldCBStringExact
mov edx, dword [rsp + 0x40]
mov rcx, rbx
call sub.mfc90u.dll_COleControl::AmbientScaleUnits
lea r8, [rsp + 0x80]
mov edx, 0x20
mov rcx, qword [rbx + 8]
call qword [sym.imp.GDI32.dll_GetObjectW]
mov r11d, dword [rsp + 0x84]
mov dword [r14], r11d
mov eax, dword [rsp + 0x88]
mov dword [r14 + 4], eax
xor eax, eax
jmp 0x140031638
call fcn.140004490
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
mov dword [rsp + 0x20], esi
mov r8, rdi
lea rdx, str.failed_4__file___S__err:__d__hr__0x_x
mov rcx, rbx
call fcn.140004510
mov dword [rsp + 0x48], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x48]
call sub.MSVCR90.dll__CxxThrowException
mov dword [rsp + 0x50], 1
lea rdx, [0x1400bcf38]
lea rcx, [rsp + 0x50]
call sub.MSVCR90.dll__CxxThrowException
nop
or eax, 0xffffffff
lea r11, [rsp + 0xa0]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rdi, qword [r11 + 0x30]
mov r12, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r13
ret