Function at 0x140020830
Capabilities:
Create directory
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
push rdi
push r12
lea rbp, [rsp - 0x7a8]
sub rsp, 0x8a8
mov rax, qword [0x140067010]
xor rax, rsp
mov qword [rbp + 0x790], rax
mov r12, rcx
test rcx, rcx
je 0x140020bb1
mov rcx, qword [0x140067b00]
lea rax, [0x140067b00]
cmp rcx, rax
je 0x140020895
test byte [rcx + 0x1c], 4
je 0x140020895
mov rcx, qword [rcx + 0x10]
lea rax, str.SaveECCommandError
mov edx, 0xa
mov qword [rsp + 0x20], rax
call fcn.140031fc0
xor edx, edx
lea rcx, [rbp + 0x580]
mov r8d, 0x208
call fcn.140034ac0
xor edx, edx
lea rcx, [rbp + 0x160]
mov r8d, 0x208
call fcn.140034ac0
xor ebx, ebx
lea r9, [rsp + 0x40]
xor r8d, r8d
mov qword [rsp + 0x40], rbx
xor edx, edx
lea rcx, [0x14004dab0]
mov edi, ebx
call qword [sym.imp.ext_ms_win_shell32_shellfolders_l1_1_0.dll_SHGetKnownFolderPath]
test eax, eax
jne 0x1400208fa
mov r8, qword [rsp + 0x40]
lea rcx, [rbp + 0x160]
mov edx, 0x104
call fcn.140036978
lea edi, [rbx + 1]
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x14002090a
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
test edi, edi
je 0x140020bb1
xor edx, edx
mov qword [rsp + 0x8a0], r15
mov r8d, 0x208
lea rcx, [rbp + 0x370]
call fcn.140034ac0
lea r9, [rbp + 0x160]
mov edx, 0x104
lea r8, str._sASUSASUS_System_Control_Interfacelog
lea rcx, [rbp + 0x370]
call fcn.140009eb0
mov qword [rsp + 0x30], rbx
lea rcx, [rbp + 0x370]
mov dword [rsp + 0x28], 0x2000080
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 3
xor edx, edx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
je 0x14002098b
mov rcx, rax
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
jmp 0x140020a0d
xor edx, edx
lea rcx, [rsp + 0x50]
mov r8d, 0x208
call fcn.140034ac0
lea r9, [rbp + 0x160]
mov edx, 0x104
lea r8, str._sASUS
lea rcx, [rsp + 0x50]
call fcn.140009eb0
xor edx, edx
lea rcx, [rsp + 0x50]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateDirectoryW]
lea r8, str.ASUS_System_Control_Interface
mov edx, 0x104
lea rcx, [rsp + 0x50]
call fcn.140040220
xor edx, edx
lea rcx, [rsp + 0x50]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateDirectoryW]
lea r8, str.log
mov edx, 0x104
lea rcx, [rsp + 0x50]
call fcn.140040220
xor edx, edx
lea rcx, [rsp + 0x50]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateDirectoryW]
lea r9, [rbp + 0x370]
mov edx, 0x104
lea r8, str._sAsusUefiLog.txt
lea rcx, [rbp + 0x580]
call fcn.140009eb0
mov qword [rsp + 0x30], rbx
lea rcx, [rbp + 0x580]
mov dword [rsp + 0x28], 0x80
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 4
mov edx, 0xc0000000
mov r15d, ebx
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x140020ba5
xor edx, edx
mov qword [rsp + 0x8e0], r14
mov rcx, rax
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_GetFileSize]
mov r14d, eax
test eax, eax
jne 0x140020a8c
lea r15d, [rax + 1]
jmp 0x140020b4e
cmp r14d, 0x48
jbe 0x140020b4e
mov ecx, 0x48
mov qword [rsp + 0x8d8], rsi
call fcn.140032e84
mov rsi, rax
test rax, rax
je 0x140020b46
xor eax, eax
lea edx, [r14 - 0x48]
mov qword [rsi], rax
xor r9d, r9d
mov qword [rsi + 8], rax
xor r8d, r8d
mov qword [rsi + 0x10], rax
mov rcx, rdi
mov qword [rsi + 0x18], rax
mov qword [rsi + 0x20], rax
mov qword [rsi + 0x28], rax
mov qword [rsi + 0x30], rax
mov qword [rsi + 0x38], rax
mov qword [rsi + 0x40], rax
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
lea r9, [rsp + 0x40]
mov qword [rsp + 0x20], rbx
mov r8d, 0x48
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetEndOfFile]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, 0x48
mov rdx, rsi
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
mov rcx, rsi
call fcn.140032e8c
mov rsi, qword [rsp + 0x8d8]
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_SetFilePointer]
lea r9, [rsp + 0x48]
mov qword [rsp + 0x20], rbx
mov r8d, 8
mov rdx, r12
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
mov rcx, rdi
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov r14, qword [rsp + 0x8e0]
mov ebx, 1
test r15d, r15d
je 0x140020ba5
lea rcx, [rbp + 0x580]
call fcn.140031aa0
mov r15, qword [rsp + 0x8a0]
mov eax, ebx
jmp 0x140020bb3
xor eax, eax
mov rcx, qword [rbp + 0x790]
xor rcx, rsp
call fcn.140032e60
add rsp, 0x8a8
pop r12
pop rdi
pop rbx
pop rbp
ret