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

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x70
mov rax, qword [0x1404af540]
xor rax, rsp
mov qword [rsp + 0x68], rax
mov rbp, rdx
mov rsi, rcx
xor r15d, r15d
mov rcx, qword [rcx]
test rcx, rcx
je 0x14021d3bc
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x14021d3cb
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r15
mov qword [rsi + 8], r15
lea rdx, [0x1404b02f0]
lea rcx, [rsp + 0x48]
call fcn.140005e80
nop
mov rcx, rbp
call qword [sym.imp.SHLWAPI.dll_PathIsRelativeW]
mov r12, 0xffffffffffffffff
mov r14, r12
nop word [rax + rax]
inc r14
cmp word [rbp + r14*2], 0
jne 0x14021d400
test eax, eax
je 0x14021d46f
mov rdi, qword [rsp + 0x58]
mov rcx, qword [rsp + 0x60]
mov rax, rcx
sub rax, rdi
cmp r14, rax
ja 0x14021d458
lea rax, [r14 + rdi]
mov qword [rsp + 0x58], rax
lea rbx, [rsp + 0x48]
cmp rcx, 7
cmova rbx, qword [rsp + 0x48]
lea rcx, [rbx + rdi*2]
lea r8, [r14 + r14]
mov rdx, rbp
call sub.VCRUNTIME140.dll_memmove
lea rax, [rdi + r14]
mov word [rbx + rax*2], r15w
jmp 0x14021d4b6
mov qword [rsp + 0x20], r14
mov r9, rbp
mov rdx, r14
lea rcx, [rsp + 0x48]
call fcn.140003d80
jmp 0x14021d4b6
mov rax, qword [rsp + 0x60]
cmp r14, rax
ja 0x14021d4a6
lea rdi, [rsp + 0x48]
cmp rax, 7
cmova rdi, qword [rsp + 0x48]
mov qword [rsp + 0x58], r14
lea rbx, [r14 + r14]
mov r8, rbx
mov rdx, rbp
mov rcx, rdi
call sub.VCRUNTIME140.dll_memmove
mov word [rbx + rdi], r15w
jmp 0x14021d4b6
mov r9, rbp
mov rdx, r14
lea rcx, [rsp + 0x48]
call fcn.140004f70
lea rcx, [rsp + 0x48]
cmp qword [rsp + 0x60], 7
cmova rcx, qword [rsp + 0x48]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
mov edx, 0x80000000
mov r8d, 1
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbp, rax
cmp rax, r12
jne 0x14021d504
lea rdx, str.Error_opening_file
jmp 0x14021d59a
xor edx, edx
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
test eax, eax
jne 0x14021d51e
lea rdx, str.File_is_empty
jmp 0x14021d59a
cmp ebx, 0x400000
jbe 0x14021d52f
lea rdx, str.File_too_large
jmp 0x14021d59a
mov dword [rsp + 0x40], r15d
mov rcx, rbx
call fcn.1403ca480
mov rdi, rax
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x40]
mov r8d, ebx
mov rdx, rax
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [rsp + 0x40], ebx
je 0x14021d5cb
mov rcx, rdi
call fcn.1403ca488
mov rcx, qword [rsi]
test rcx, rcx
je 0x14021d57d
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x14021d58c
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r15
mov qword [rsi + 8], r15
lea rdx, str.Could_not_read_file
mov r8d, 0x63
lea rcx, [rsi + 0x18]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy]
mov r8d, reloc.SinoSPE.dll_Ordinal_49
lea rdx, [0x140419d94]
lea rcx, [rsi + 0xe0]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy]
xor bl, bl
jmp 0x14021d691
mov rbp, rdi
cmp ebx, 3
jb 0x14021d5eb
cmp byte [rdi], 0xef
jne 0x14021d5eb
cmp byte [rdi + 1], 0xbb
jne 0x14021d5eb
cmp byte [rdi + 2], 0xbf
jne 0x14021d5eb
lea rbp, [rdi + 3]
add ebx, 0xfffffffd
mov dword [rsp + 0x28], r15d
mov qword [rsp + 0x20], r15
mov r9d, ebx
mov r8, rbp
xor edx, edx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov r14d, eax
lea edx, [r14 + 1]
mov eax, 2
mul rdx
cmovb rax, r12
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rsi], rax
test rax, rax
jne 0x14021d630
xor bl, bl
jmp 0x14021d688
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], rax
mov r9d, ebx
mov r8, rbp
xor edx, edx
mov ecx, 0xfde9
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov rax, qword [rsi]
mov word [rax + r14*2], r15w
mov rcx, rsi
call fcn.14021d700
movzx ebx, al
test al, al
jne 0x14021d688
mov rcx, qword [rsi]
test rcx, rcx
je 0x14021d672
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rcx, qword [rsi + 8]
test rcx, rcx
je 0x14021d681
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rsi], r15
mov qword [rsi + 8], r15
mov rcx, rdi
call fcn.1403ca488
nop
mov rdx, qword [rsp + 0x60]
cmp rdx, 7
jbe 0x14021d6d6
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x48]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14021d6d1
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14021d6d1
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.1403ca488
movzx eax, bl
mov rcx, qword [rsp + 0x68]
xor rcx, rsp
call fcn.1403ca460
lea r11, [rsp + 0x70]
mov rbx, qword [r11 + 0x40]
mov rbp, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret