Function at 0x140020790
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0xe0]
sub rsp, 0x1e0
mov qword [rsp + 0x70], 0xfffffffffffffffe
mov rax, qword [0x1400720d0]
xor rax, rsp
mov qword [rbp + 0xd0], rax
mov rsi, r9
mov r12d, r8d
mov r15, rdx
mov rdi, rcx
mov r14, qword [rbp + 0x140]
mov dword [rsp + 0x34], 0
mov rcx, qword [rcx + 8]
cmp rcx, 0xffffffffffffffff
jne 0x14002080c
lea rdx, str.HECI_not_connected
lea rcx, [rsp + 0x58]
call fcn.14001fcf0
lea rdx, [0x1400701c0]
lea rcx, [rsp + 0x58]
call fcn.14002bac0
int3
xor eax, eax
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rax
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x34]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_WriteFile]
test eax, eax
jne 0x14002087c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x14002087c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, [0x1400522b0]
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov edx, dword [rbp + 0x148]
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x1400208b6
lea rdx, str.HECI_send_timeout
lea rcx, [rsp + 0x58]
call fcn.140002690
lea rdx, [0x14006fe80]
lea rcx, [rsp + 0x58]
call fcn.14002bac0
int3
test eax, eax
je 0x1400208ea
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, str.WaitForSingleObject_after_WriteFile
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov r9d, 1
lea r8, [rsp + 0x34]
lea rdx, [rsp + 0x38]
mov rcx, qword [rdi + 8]
call qword [sym.imp.api_ms_win_core_io_l1_1_0.dll_GetOverlappedResult]
test eax, eax
jne 0x140020938
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, str.GetOverlappedResult_from_WriteFile
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140011fe0
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
lea rdx, str.Heci::SendMsg_WriteFile_bytesWritten
call fcn.140001350
mov rcx, rax
mov edx, dword [rsp + 0x34]
call fcn.14000eda0
mov rbx, rax
mov rcx, qword [rax]
movsxd rcx, dword [rcx + 4]
add rcx, rax
mov dl, 0xa
call fcn.1400089a0
movzx edx, ax
mov rcx, rbx
call fcn.1400083e0
mov rcx, rbx
call fcn.140007de0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eab0
nop
lea rbx, vtable.std::ios_base.0
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.140027ccc
nop
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140011fe0
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
mov r8d, r12d
mov rdx, r15
call fcn.140010240
nop
lea rcx, [rbp + 0x18]
call fcn.14000eab0
nop
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.140027ccc
nop
xor eax, eax
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rax
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x50], rax
mov dword [rsp + 0x30], 0
test rsi, rsi
je 0x140020c10
test r14, r14
je 0x140020c10
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x30]
mov r8d, dword [rdi + 0x10]
mov rdx, rsi
mov rcx, qword [rdi + 8]
call qword [sym.imp.api_ms_win_core_file_l1_1_0.dll_ReadFile]
test eax, eax
jne 0x140020a8c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x140020a8c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, [0x140052350]
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov edx, dword [rbp + 0x150]
mov rcx, qword [rdi + 0x18]
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x140020ac6
lea rdx, str.HECI_recv_timeout
lea rcx, [rsp + 0x58]
call fcn.140002690
lea rdx, [0x14006fe80]
lea rcx, [rsp + 0x58]
call fcn.14002bac0
int3
test eax, eax
je 0x140020afa
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, str.WaitForSingleObject_after_ReadFile
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov r9d, 1
lea r8, [rsp + 0x30]
lea rdx, [rsp + 0x38]
mov rcx, qword [rdi + 8]
call qword [sym.imp.api_ms_win_core_io_l1_1_0.dll_GetOverlappedResult]
test eax, eax
jne 0x140020b48
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, str.GetOverlappedResult_from_ReadFile
lea rcx, [rbp + 0x80]
call fcn.140009550
lea rdx, [0x1400700f0]
lea rcx, [rbp + 0x80]
call fcn.14002bac0
int3
mov eax, dword [rsp + 0x30]
mov dword [r14], eax
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140011fe0
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
lea rdx, str.Heci::SendMsg_ReadFile_bytesRead
call fcn.140001350
mov rcx, rax
mov edx, dword [rsp + 0x30]
call fcn.14000eda0
mov rbx, rax
mov rcx, qword [rax]
movsxd rcx, dword [rcx + 4]
add rcx, rax
mov dl, 0xa
call fcn.1400089a0
movzx edx, ax
mov rcx, rbx
call fcn.1400083e0
mov rcx, rbx
call fcn.140007de0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eab0
nop
lea rbx, vtable.std::ios_base.0
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.140027ccc
nop
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140011fe0
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
mov r8d, dword [rsp + 0x30]
mov rdx, rsi
call fcn.140010240
nop
lea rcx, [rbp + 0x18]
call fcn.14000eab0
nop
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.140027ccc
nop
mov rcx, qword [rbp + 0xd0]
xor rcx, rsp
call fcn.1400291d0
add rsp, 0x1e0
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret