Function at 0x140041674
Capabilities:
Get file size
Get system information on windows
Read file via mapping

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xb0
mov rsi, r9
mov rdi, r8
mov r8, rdx
xor r12d, r12d
mov ebx, r12d
mov dword [rsp + 0x48], ebx
mov qword [rsp + 0x68], r12
test rcx, rcx
je 0x1400416b9
mov rax, qword [rcx + 0x1d0]
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x38], r12
mov r13d, r12d
mov dword [rsp + 0x40], r12d
mov r14, r12
mov qword [rsp + 0x50], r12
mov r15, rsi
lea rdx, [rsp + 0x50]
mov rcx, r8
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
nop dword [rax + rax]
test rsi, rsi
jne 0x140041701
lea eax, [rsi + 1]
add rsp, 0xb0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov qword [rsp + 0x28], r12
mov rax, qword [rsp + 0x50]
mov dword [rsp + 0x20], eax
mov r9d, dword [rsp + 0x54]
xor edx, edx
lea r8d, [rdx + 2]
mov rcx, qword [rsp + 0xf8]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
nop dword [rax + rax]
mov qword [rsp + 0x58], rax
test rax, rax
je 0x1400417ee
mov rbx, rdi
xorps xmm0, xmm0
movups xmmword [rsp + 0x78], xmm0
movups xmmword [rsp + 0x88], xmm0
movups xmmword [rsp + 0x98], xmm0
mov dword [rsp + 0x108], r12d
lea rcx, [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
nop dword [rax + rax]
mov ecx, dword [rsp + 0xa0]
mov rax, rdi
cqo
idiv rcx
test rdx, rdx
je 0x14004179f
xor edx, edx
mov eax, edi
div dword [rsp + 0xa0]
mov eax, edx
mov dword [rsp + 0x108], eax
sub rbx, rax
lea r15, [rdx + rsi]
mov eax, r15d
mov r8, rbx
shr r8, 0x20
mov qword [rsp + 0x20], rax
mov r9d, ebx
mov edx, 4
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
nop dword [rax + rax]
mov r8, rax
mov qword [rsp + 0x38], rax
test rax, rax
je 0x1400417e8
mov ecx, 1
mov ebx, ecx
mov r9d, dword [rsp + 0x108]
add r9, rax
jmp 0x1400417fb
mov ebx, dword [rsp + 0x48]
jmp 0x1400417f3
mov r8, qword [rsp + 0x38]
mov ecx, 1
mov r9, r12
test ebx, ebx
je 0x140041b27
movabs r10, 0xffffffffffffff
cmp r14, rsi
jge 0x140041b3a
mov rdx, r9
add r14, 0x32
mov qword [rsp + 0x70], r14
add r9, 0x32
mov qword [rsp + 0x48], r9
mov qword [rsp + 0x108], r9
mov eax, r9d
sub eax, r8d
cmp eax, r15d
jbe 0x140041855
mov ebx, r12d
mov dword [rsp + 0x34], ebx
mov r13d, 0xd
mov dword [rsp + 0x30], r13d
jmp 0x140041b3a
cmp dword [0x1400bacd8], r12d
jne 0x14004187b
test byte [rdx + 7], 0x10
jne 0x14004187b
cmp qword [rdx + 8], rdi
jg 0x140041879
mov rax, qword [rdx]
and rax, r10
add rax, qword [rdx + 8]
cmp rax, rdi
jle 0x14004187b
jmp 0x14004180d
test byte [rdx + 7], 0xc0
jne 0x140041879
test byte [rdx + 7], cl
je 0x1400418ac
mov rcx, qword [rsp + 0xf0]
call fcn.140041ce0
jmp 0x140041b17
mov ecx, 1
mov r8, qword [rsp + 0x38]
mov r9, qword [rsp + 0x48]
jmp 0x140041803
mov r8, qword [rdx + 0x1e]
sub r8, qword [0x1400bace0]
jne 0x1400418d3
mov r8, qword [rdx + 0x26]
sub r8, qword [0x1400bace8]
jne 0x1400418d3
mov r8d, dword [rdx + 0x2e]
mov eax, dword [0x1400bacf0]
sub r8, rax
mov eax, r12d
test r8, r8
cmove eax, ecx
test eax, eax
je 0x1400418f0
test byte [rdx + 7], 0x10
jne 0x1400418f0
mov r8, qword [rsp + 0x38]
jmp 0x14004180d
mov rcx, qword [rsp + 0xf0]
call fcn.140041ce0
mov r10, rax
mov qword [rsp + 0x60], rax
test rax, rax
je 0x140041b20
test byte [rax + 0xf], 0x10
je 0x1400419f7
mov r9d, dword [rax + 0x1c]
mov eax, 1
test al, r9b
je 0x1400419f7
mov r8, qword [r10 + 8]
movabs rax, 0xffffffffffffff
and r8, rax
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], r12
mov rdx, qword [r10 + 0x10]
mov rcx, qword [rsp + 0xf0]
call fcn.14003d29c
mov edx, eax
mov dword [rsp + 0x108], eax
test eax, eax
jns 0x14004198b
mov qword [rsp + 0x20], r12
mov r9d, eax
mov r8d, 0x315
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_resnode.c
lea rcx, str.ResNodesLoad
call fcn.140046874
mov edx, dword [rsp + 0x108]
test edx, edx
jns 0x140041898
mov ecx, edx
bt edx, 0x1c
jae 0x1400419d0
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
cmp eax, 0x13d
jne 0x1400419b8
mov r13d, dword [rsp + 0x108]
jmp 0x1400419e6
mov ecx, dword [rsp + 0x108]
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov r13d, eax
jmp 0x1400419e6
and ecx, 0x1fff0000
movzx eax, dx
mov r13d, edx
cmp ecx, 0x70000
cmove r13d, eax
mov dword [rsp + 0x30], r13d
mov ebx, r12d
mov dword [rsp + 0x34], ebx
jmp 0x140041b3a
test byte [r10 + 0xf], 2
je 0x140041b00
mov dword [rsp + 0x44], r12d
mov ecx, dword [r10 + 0x24]
add ecx, dword [rsp + 0x40]
or eax, 0xffffffff
cmp ecx, dword [rsp + 0x40]
cmovae eax, ecx
mov dword [rsp + 0x40], eax
sbb edx, edx
and edx, 0x80070216
mov dword [rsp + 0x108], edx
mov dword [rsp + 0x44], edx
jge 0x140041a5f
mov qword [rsp + 0x20], r12
mov r9d, edx
mov r8d, 0x329
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_resnode.c
lea rcx, str.ResNodesLoad
call fcn.140046874
mov edx, dword [rsp + 0x108]
mov r10, qword [rsp + 0x60]
test edx, edx
js 0x140041993
mov rdx, r10
mov rcx, qword [rsp + 0xf0]
call fcn.14002f0f0
test rax, rax
jne 0x140041aec
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ecx, eax
movzx eax, ax
or eax, 0x80070000
test ecx, ecx
cmovle eax, ecx
test eax, eax
jns 0x140041ab7
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx edx, ax
or edx, 0x80070000
test eax, eax
cmovle edx, eax
jmp 0x140041abc
mov edx, 0x80004005
mov dword [rsp + 0x108], edx
mov dword [rsp + 0x44], edx
test edx, edx
jns 0x140041afb
mov qword [rsp + 0x20], r12
mov r9d, edx
mov r8d, 0x330
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmain_resnode.c
lea rcx, str.ResNodesLoad
call fcn.140046874
mov edx, dword [rsp + 0x108]
test edx, edx
js 0x140041993
mov r10, qword [rsp + 0x60]
lea rdx, [r10 + 0x28]
mov r9, r10
mov r8d, reloc.Cabinet.dll_FDICreate
mov rcx, qword [rsp + 0x68]
call fcn.140031374
test rax, rax
jne 0x140041898
mov ebx, r12d
mov dword [rsp + 0x34], ebx
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov dword [rsp + 0x30], eax
mov r13d, eax
mov edi, 1
jmp 0x140041b58
mov rcx, qword [rsp + 0x38]
test rcx, rcx
je 0x140041b6e
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
nop dword [rax + rax]
mov rax, qword [rsp + 0x58]
test rax, rax
je 0x140041b87
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
mov rax, qword [rsp + 0xf0]
test ebx, ebx
je 0x140041bed
movzx ecx, r12w
test rax, rax
je 0x140041ba8
cmp dword [rax], 0xfeedf001
jne 0x140041ba8
movzx ecx, word [rax + 0x58]
cmp cx, di
ja 0x140041bcc
test rax, rax
je 0x140041bbd
cmp dword [rax], 0xfeedf001
jne 0x140041bbd
mov edi, dword [rax + 0x5c]
cmp dword [rsp + 0x40], edi
je 0x140041bcc
mov r13d, 0xd
mov ebx, r12d
test ebx, ebx
je 0x140041bed
mov rcx, rax
call fcn.140041144
mov ebx, eax
test eax, eax
jne 0x140041bed
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov r13d, eax
test r13d, r13d
je 0x140041c01
mov ecx, r13d
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov eax, ebx
jmp 0x1400416ed