Function at 0x140020740
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 [0x1400700d0]
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 0x1400207bc
lea rdx, str.HECI_not_connected
lea rcx, [rsp + 0x58]
call fcn.14001fcf0
lea rdx, [0x14006dcf0]
lea rcx, [rsp + 0x58]
call fcn.14002a5e0
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 0x14002082c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x14002082c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, [0x140050270]
lea rcx, [rbp + 0x80]
call fcn.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
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 0x140020866
lea rdx, str.HECI_send_timeout
lea rcx, [rsp + 0x58]
call fcn.140002690
lea rdx, [0x14006d9b0]
lea rcx, [rsp + 0x58]
call fcn.14002a5e0
int3
test eax, eax
je 0x14002089a
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.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
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 0x1400208e8
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.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
int3
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140012040
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.14000ee10
mov rbx, rax
mov rcx, qword [rax]
movsxd rcx, dword [rcx + 4]
add rcx, rax
mov dl, 0xa
call fcn.140008a80
movzx edx, ax
mov rcx, rbx
call fcn.1400084b0
mov rcx, rbx
call fcn.140007eb0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eb20
nop
lea rbx, vtable.std::ios_base.0
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.14002675c
nop
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140012040
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
mov r8d, r12d
mov rdx, r15
call fcn.1400102b0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eb20
nop
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.14002675c
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 0x140020bc0
test r14, r14
je 0x140020bc0
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 0x140020a3c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
cmp eax, 0x3e5
je 0x140020a3c
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov r8d, eax
lea rdx, [0x140050310]
lea rcx, [rbp + 0x80]
call fcn.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
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 0x140020a76
lea rdx, str.HECI_recv_timeout
lea rcx, [rsp + 0x58]
call fcn.140002690
lea rdx, [0x14006d9b0]
lea rcx, [rsp + 0x58]
call fcn.14002a5e0
int3
test eax, eax
je 0x140020aaa
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.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
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 0x140020af8
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.140009630
lea rdx, [0x14006dc20]
lea rcx, [rbp + 0x80]
call fcn.14002a5e0
int3
mov eax, dword [rsp + 0x30]
mov dword [r14], eax
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140012040
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.14000ee10
mov rbx, rax
mov rcx, qword [rax]
movsxd rcx, dword [rcx + 4]
add rcx, rax
mov dl, 0xa
call fcn.140008a80
movzx edx, ax
mov rcx, rbx
call fcn.1400084b0
mov rcx, rbx
call fcn.140007eb0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eb20
nop
lea rbx, vtable.std::ios_base.0
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.14002675c
nop
mov edx, 1
lea rcx, [rsp + 0x78]
call fcn.140012040
nop
mov dword [rax + 0x90], 0x64
lea rcx, [rax + 0x10]
mov r8d, dword [rsp + 0x30]
mov rdx, rsi
call fcn.1400102b0
nop
lea rcx, [rbp + 0x18]
call fcn.14000eb20
nop
mov qword [rbp + 0x18], rbx
lea rcx, [rbp + 0x18]
call fcn.14002675c
nop
mov rcx, qword [rbp + 0xd0]
xor rcx, rsp
call fcn.140027c60
add rsp, 0x1e0
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret