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

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x98
xor esi, esi
mov rbp, rcx
mov r12d, edx
mov r13d, r8d
mov qword [rsp + 0x88], 0
xor r8d, r8d
mov r14d, r9d
xor r9d, r9d
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov edx, 0x80000000
mov rcx, qword [rsp + 0x108]
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov rbx, rax
je 0x40fe65
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov edi, eax
jne 0x40fe80
xor esi, esi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
add rsp, 0x98
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
test rax, rax
mov r15, rax
je 0x40fe5a
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x6c]
mov r8d, edi
mov rdx, rax
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40fec1
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40fe5c
lea r8, [rsp + 0x78]
mov edx, 1
mov rcx, r15
call qword [sym.imp.ole32.dll_CreateStreamOnHGlobal]
lea rax, [rsp + 0x80]
mov rcx, qword [rsp + 0x78]
mov edx, edi
mov qword [rsp + 0x20], rax
mov r9, qword [0x0042ecf0]
mov r8d, 1
call qword [sym.imp.OLEAUT32.dll_OleLoadPicture]
mov rcx, qword [rsp + 0x80]
test rcx, rcx
je 0x40feb6
mov rax, qword [rcx]
lea rdx, [rsp + 0x70]
call qword [rax + 0x30]
mov rcx, qword [rsp + 0x80]
lea rdx, [rsp + 0x74]
mov rax, qword [rcx]
call qword [rax + 0x38]
mov eax, dword [rsp + 0x110]
test eax, eax
je 0x40ffda
mov edx, dword [rsp + 0x74]
pxor xmm1, xmm1
pxor xmm2, xmm2
mov eax, dword [rsp + 0x70]
cvtsi2sd xmm1, edx
cvtsi2sd xmm2, eax
cmp edx, eax
jle 0x4100ab
pxor xmm0, xmm0
cvtsi2sd xmm0, dword [rsp + 0x100]
mulsd xmm0, xmm2
divsd xmm0, xmm1
cvttsd2si eax, xmm0
pxor xmm0, xmm0
cmp r14d, eax
cmovle eax, r14d
cvtsi2sd xmm0, eax
mulsd xmm1, xmm0
divsd xmm1, xmm2
cvttsd2si edx, xmm1
mov r8d, eax
sub r8d, r14d
mov r14d, eax
mov ecx, r8d
shr ecx, 0x1f
add ecx, r8d
mov r8d, ecx
sar ecx, 0x1f
sar r8d, 1
xor r8d, ecx
sub r8d, ecx
add r12d, r8d
mov r8d, edx
sub r8d, dword [rsp + 0x100]
mov dword [rsp + 0x100], edx
mov ecx, r8d
shr ecx, 0x1f
add ecx, r8d
mov r8d, ecx
sar ecx, 0x1f
sar r8d, 1
xor r8d, ecx
sub r8d, ecx
add r13d, r8d
lea rdx, [rsp + 0x88]
mov rcx, rbp
call qword [sym.imp.GDI32.dll_GetViewportOrgEx]
mov edi, dword [rsp + 0x100]
lea r10d, [r12 + r14 - 1]
mov r8d, dword [rsp + 0x8c]
mov eax, dword [rsp + 0x88]
lea r9d, [r13 + rdi - 1]
lea edx, [r8 + r13]
add r9d, r8d
lea ecx, [rax + r12]
lea r8d, [r10 + rax]
call qword [sym.imp.GDI32.dll_CreateRectRgn]
mov rcx, rbp
mov rdi, qword [sym.imp.GDI32.dll_SelectClipRgn]
mov rsi, rax
mov rdx, rax
call rdi
mov eax, dword [rsp + 0x74]
mov r9d, r13d
mov r8d, r12d
mov rcx, qword [rsp + 0x80]
mov edx, eax
neg edx
mov r10, qword [rcx]
mov dword [rsp + 0x38], eax
mov dword [rsp + 0x48], edx
mov eax, dword [rsp + 0x100]
mov edx, dword [rsp + 0x70]
mov dword [rsp + 0x30], 0
mov qword [rsp + 0x50], 0
mov dword [rsp + 0x20], r14d
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x40], edx
mov rdx, rbp
call qword [r10 + 0x40]
xor edx, edx
mov rcx, rbp
call rdi
mov rcx, rsi
mov esi, 1
call qword [sym.imp.GDI32.dll_DeleteObject]
mov rcx, qword [rsp + 0x80]
mov rax, qword [rcx]
call qword [rax + 0x10]
jmp 0x40feb6
pxor xmm0, xmm0
cvtsi2sd xmm0, r14d
mulsd xmm0, xmm1
divsd xmm0, xmm2
cvttsd2si edx, xmm0
cmp dword [rsp + 0x100], edx
pxor xmm0, xmm0
cmovle edx, dword [rsp + 0x100]
cvtsi2sd xmm0, edx
mulsd xmm0, xmm2
divsd xmm0, xmm1
cvttsd2si eax, xmm0
jmp 0x40ff89