Function at 0x14001f690
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
push rbp
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x70
mov r15, r8
mov rcx, rdx
xor r12d, r12d
xor r9d, r9d
mov qword [rax - 0x68], r12
xor r8d, r8d
mov dword [rax - 0x70], 0x80
mov edx, 0x80000000
mov dword [rax - 0x78], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
or r14, 0xffffffffffffffff
mov rdi, rax
cmp rax, r14
je 0x14001f928
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
test eax, eax
je 0x14001f960
cmp ebx, 0x100000
ja 0x14001f9a1
mov ecx, ebx
call qword [sym.imp.msvcrt.dll_malloc]
mov rsi, rax
mov rcx, rdi
test rax, rax
je 0x14001f9ce
lea r9, [rbp + 0x48]
mov qword [rsp + 0x20], r12
mov r8d, ebx
mov rdx, rax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x14001f9ec
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, dword [rbp + 0x48]
jne 0x14001fa36
mov eax, dword [rbp + 0x48]
lea rdi, [rax*2 + 0x20]
mov rcx, rdi
call qword [sym.imp.msvcrt.dll_malloc]
mov rbx, rax
test rax, rax
je 0x14001fa69
mov r8, rdi
xor edx, edx
mov rcx, rax
call sub.msvcrt.dll_memset
lea r8, str._root_
mov rdx, rbx
mov rcx, r8
sub rdx, r8
movzx eax, word [rcx]
mov word [rdx + rcx], ax
lea rcx, [rcx + 2]
test ax, ax
jne 0x14001f78a
mov rax, r14
inc rax
cmp word [r8 + rax*2], r12w
jne 0x14001f79d
mov r9d, dword [rbp + 0x48]
lea rdi, [rbx + rax*2]
mov dword [rsp + 0x28], r9d
mov r8, rsi
xor edx, edx
mov qword [rsp + 0x20], rdi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x14001f8fe
mov eax, dword [rbp + 0x48]
lea rcx, str.__root_
lea rdx, [rdi + rax*2]
movzx eax, word [rcx]
lea rcx, [rcx + 2]
mov word [rdx], ax
lea rdx, [rdx + 2]
test ax, ax
jne 0x14001f7dc
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
mov edi, 7
mov qword [rbp - 0x10], r12
mov qword [rbp - 8], rdi
mov r8, r14
mov word [rbp - 0x20], r12w
inc r8
cmp word [rbx + r8*2], r12w
jne 0x14001f80d
mov rdx, rbx
lea rcx, [rbp - 0x28]
call fcn.140002f48
lea rdx, [rbp - 0x28]
mov rcx, r15
call fcn.14002a52c
test eax, eax
jns 0x14001f89a
xor r9d, r9d
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], r12d
lea rcx, str.c:_bad.xml
mov edx, 0xc0000000
mov dword [rsp + 0x20], 2
lea r8d, [r9 + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, r14
je 0x14001f889
mov rcx, r14
inc rcx
cmp word [rbx + rcx*2], r12w
jne 0x14001f866
lea r8d, [rcx + rcx]
mov qword [rsp + 0x20], r12
mov rcx, rax
lea r9, [rbp - 0x30]
mov rdx, rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
lea rdx, str.Couldnt_validate_XML_file
mov ecx, 0x80004005
call fcn.14001aa8c
mov qword [rbp - 8], rdi
lea rdx, [0x14004a0d8]
mov qword [rbp - 0x10], r12
mov word [rbp - 0x20], r12w
inc r14
cmp word [rdx + r14*2], r12w
jne 0x14001f8ae
mov r8, r14
lea rcx, [rbp - 0x28]
call fcn.140002f48
lea rdx, [rbp - 0x28]
mov rcx, r15
call fcn.14002a294
test al, al
jne 0x14001f8e5
lea rdx, str.Missing_BETest_element
mov ecx, 0x80004005
call fcn.14001aa8c
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
lea rdx, [0x140047d38]
mov dword [rbp - 0x30], 0x80004005
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Invalid_components_file__CreateFile_returned___lu_n
mov ebx, eax
call sub.msvcrt.dll_wprintf
movzx ecx, bx
lea rdx, [0x140047d38]
or ecx, 0x80070000
test ebx, ebx
cmovle ecx, ebx
mov dword [rbp - 0x30], ecx
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Invalid_components_file__GetFileSize_returned___lu_n
mov ebx, eax
call sub.msvcrt.dll_wprintf
movzx ecx, bx
lea rdx, [0x140047d38]
or ecx, 0x80070000
test ebx, ebx
cmovle ecx, ebx
mov dword [rbp - 0x30], ecx
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, str.Invalid_components_file__Provide_a_file_with_a_size_of_less_than_1_MB_n
call sub.msvcrt.dll_wprintf
lea rdx, [0x140047d38]
mov dword [rbp - 0x30], 0x80004005
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rdx, [0x140047d38]
mov dword [rbp - 0x30], 0x8007000e
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
mov edx, ebx
lea rcx, str.Invalid_components_file__ReadFile_returned___lu_n
call sub.msvcrt.dll_wprintf
movzx ecx, bx
lea rdx, [0x140047d38]
or ecx, 0x80070000
test ebx, ebx
cmovle ecx, ebx
mov dword [rbp - 0x30], ecx
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
mov r8d, dword [rbp + 0x48]
lea rcx, str.Components_selection_file_is_supposed_to_have__lu_bytes_but_only__lu_bytes_are_read_n
mov edx, ebx
call sub.msvcrt.dll_wprintf
lea rdx, [0x140047d38]
mov dword [rbp - 0x30], 0x80004005
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3
mov rcx, rsi
call qword [sym.imp.msvcrt.dll_free]
lea rdx, [0x140047d38]
mov dword [rbp - 0x30], 0x8007000e
lea rcx, [rbp - 0x30]
call sub.msvcrt.dll__CxxThrowException
int3