Function at 0x140047c5c
Capabilities:
Get file size
Read file via mapping

Disassembly:
mov rax, rsp
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], r8
push rsi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r14, rdx
mov r13, rcx
mov ebx, 0x80004005
mov dword [rax - 0x54], ebx
xor esi, esi
mov qword [rax + 8], rsi
xor r12d, r12d
and qword [rax + 0x18], rsi
xor r15d, r15d
test rcx, rcx
je 0x140047eb4
cmp rdx, 0xffffffffffffffff
je 0x140047eb4
lea rdx, [rax + 0x18]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
nop dword [rax + rax]
test eax, eax
jne 0x140047d07
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ecx, ax
mov r14d, 0x80070000
or ecx, r14d
test eax, eax
cmovle ecx, eax
test ecx, ecx
jns 0x140047cf4
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ebx, ax
or ebx, r14d
test eax, eax
cmovle ebx, eax
test ebx, ebx
jns 0x140047eda
mov r8d, 0xe2
jmp 0x140047ebf
cmp dword [rsp + 0xa4], esi
je 0x140047d20
mov ebx, 0x8007000d
mov r8d, 0xea
jmp 0x140047ebf
and qword [rsp + 0x28], rsi
mov eax, dword [rsp + 0xa0]
mov dword [rsp + 0x20], eax
xor r9d, r9d
xor edx, edx
lea r8d, [r9 + 2]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
nop dword [rax + rax]
mov r12, rax
mov qword [rsp + 0xa8], rax
test rax, rax
jne 0x140047da3
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ecx, ax
mov r14d, 0x80070000
or ecx, r14d
test eax, eax
cmovle ecx, eax
test ecx, ecx
jns 0x140047d90
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ebx, ax
or ebx, r14d
test eax, eax
cmovle ebx, eax
test ebx, ebx
jns 0x140047eda
mov r8d, 0xf6
jmp 0x140047ebf
and qword [rsp + 0x20], rsi
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 + 4]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
nop dword [rax + rax]
mov r15, rax
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x140047e19
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ecx, ax
mov r14d, 0x80070000
or ecx, r14d
test eax, eax
cmovle ecx, eax
test ecx, ecx
jns 0x140047e06
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
movzx ebx, ax
or ebx, r14d
test eax, eax
cmovle ebx, eax
test ebx, ebx
jns 0x140047eda
mov r8d, 0x101
jmp 0x140047ebf
lea rax, [rsp + 0x90]
mov qword [rsp + 0x20], rax
mov r8, qword [rsp + 0xa0]
mov rdx, r15
mov rcx, r13
call fcn.140047ac8
mov ebx, eax
mov dword [rsp + 0x40], eax
test eax, eax
jns 0x140047e65
and qword [rsp + 0x20], 0
mov r9d, eax
mov r8d, 0x10a
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmetadata_readmd.c
lea rcx, str.ReadMetaDataFile
call fcn.140046874
mov rsi, qword [rsp + 0x90]
jmp 0x140047eda
mov ebx, 0x80070057
mov r8d, 0xda
and qword [rsp + 0x20], rsi
mov r9d, ebx
lea rdx, str.onecore_base_ntsetupopktoolsosimagelibmetadata_readmd.c
lea rcx, str.ReadMetaDataFile
call fcn.140046874
test r15, r15
je 0x140047eee
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
nop dword [rax + rax]
test r12, r12
je 0x140047f02
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop dword [rax + rax]
test ebx, ebx
jns 0x140047f62
test rsi, rsi
je 0x140047f15
mov rcx, rsi
call fcn.140036ec0
xor esi, esi
mov ecx, ebx
bt ebx, 0x1c
jae 0x140047f42
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
cmp eax, 0x13d
je 0x140047f54
mov ecx, ebx
call qword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
nop dword [rax + rax]
mov ebx, eax
jmp 0x140047f54
and ecx, 0x1fff0000
movzx eax, bx
cmp ecx, 0x70000
cmove ebx, eax
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop dword [rax + rax]
mov rax, rsi
mov rbx, qword [rsp + 0x98]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rsi
ret