Function at 0x2100c9790
Capabilities:
Connect pipe
Read file on windows
Read pipe
Write file on windows
Write pipe

Disassembly:
push r15
mov eax, 0xa128
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.21021b550
sub rsp, rax
mov rax, qword [r8 + 0xc0]
cmp ecx, 1
mov rsi, rdx
mov edx, dword [r8 + 0x90]
mov rdi, r8
cmove rax, qword [r8 + 0xb8]
xor r8d, r8d
mov dword [rsp + 0xa170], ecx
mov qword [rsp + 0xa188], r9
xor r9d, r9d
mov qword [rsp + 0x90], rax
lea rax, [rsp + 0xe0]
mov rcx, rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0xe0], 0
mov qword [rsp + 0xe8], 0
mov qword [rsp + 0xf0], 0
mov qword [rsp + 0xf8], 0
mov qword [rsp + 0x100], 0
mov qword [rsp + 0x108], 0
mov qword [rsp + 0x110], 0
mov qword [rsp + 0x118], 0
call method.pinfo.init_int__unsigned_int__void_
mov rax, qword [rsp + 0x108]
xor edx, edx
mov ecx, 0x40
mov r8d, dword [rax + 0x14]
call sym.OpenProcess
mov r12, rax
test rax, rax
je 0x2100c9f80
call sym.GetCurrentProcess
mov dword [rsp + 0x30], 2
mov rcx, r12
mov rdx, qword [rsp + 0x90]
mov dword [rsp + 0x28], 1
mov r8, rax
lea r9, [rsp + 0x90]
lea rbp, [rsp + 0x8c]
mov dword [rsp + 0x20], 0
call sym.DuplicateHandle
mov rcx, r12
call sym.CloseHandle
lea rax, [rsp + 0x98]
mov qword [rsp + 0x48], rax
cmp dword [rsp + 0xa170], 1
jne 0x2100c9a80
mov eax, dword [rdi + 0xd8]
cmp byte [rdi + 0xc8], 0
mov dword [rsp + 0x44], 0xfde9
mov dword [rsp + 0x60], eax
je 0x2100ca070
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov rcx, qword [rsp + 0x48]
mov eax, dword [rax - 0x2cc8]
mov dword [rsp + 0x98], eax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov eax, dword [rax - 0x2cc4]
mov dword [rsp + 0x9c], eax
call method.tmp_pathbuf.c_get__
mov rbx, rax
mov byte [rsp + 0x66], 0
lea r13, [rsp + 0xa0]
lea r15, [rsp + 0x120]
nop word cs:[rax + rax]
mov rdx, rsi
mov rcx, rbp
call sym.bytes_available_unsigned_int__void_
mov r12d, eax
test al, al
je 0x2100c9e80
mov r8d, dword [rsp + 0x8c]
test r8d, r8d
je 0x2100c9e80
mov eax, 0x8000
mov r9, r13
mov rdx, rbx
mov rcx, rsi
mov qword [rsp + 0x20], 0
cmp r8d, eax
cmova r8d, eax
mov dword [rsp + 0xa0], r8d
call sym.ReadFile
cmp byte [rdi + 0x129], 0
jne 0x2100c9960
cmp dword [rsp + 0xa170], 1
je 0x2100c9c30
mov edx, dword [rsp + 0x44]
cmp dword [rsp + 0x60], edx
je 0x2100c9c10
mov rcx, qword [rsp + 0x48]
call method.tmp_pathbuf.c_get__
mov qword [rsp + 0x20], rbx
mov r9d, dword [rsp + 0x60]
mov r8, r15
mov r14, rax
mov ecx, dword [rsp + 0x44]
lea rax, [0x2102ff788]
mov qword [rsp + 0x120], 0x8000
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0xa0]
mov rdx, r14
mov qword [rsp + 0x28], rax
call sym.convert_mb_str_unsigned_int__char__unsigned_long__unsigned_int__char_const__unsigned_long___mbstate_t___clone_constprop0_
mov rax, qword [rsp + 0x120]
mov dword [rsp + 0xa0], eax
mov r8d, eax
test eax, eax
je 0x2100c9960
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x90]
mov r9, r13
mov rdx, r14
call sym.WriteFile
test eax, eax
je 0x2100c9960
mov eax, dword [rsp + 0xa0]
test eax, eax
movzx eax, byte [rsp + 0x66]
cmovne eax, r12d
mov byte [rsp + 0x66], al
jmp 0x2100c9960
call sym.GetConsoleCP
mov rcx, qword [rsp + 0x48]
mov dword [rsp + 0x60], eax
mov eax, dword [rdi + 0xd8]
mov dword [rsp + 0x44], eax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov eax, dword [rax - 0x2cc8]
mov dword [rsp + 0x98], eax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov eax, dword [rax - 0x2cc4]
mov dword [rsp + 0x9c], eax
call method.tmp_pathbuf.c_get__
mov r10d, dword [rsp + 0xa170]
mov rbx, rax
test r10d, r10d
jne 0x2100c9941
movzx eax, byte [rdi + 0xc8]
mov byte [rsp + 0x67], al
test al, al
je 0x2100c9941
lea rax, [rsp + 0x120]
mov byte [rsp + 0x66], 0
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x58], rbx
mov qword [rsp + 0xa180], rdi
nop dword [rax]
mov rbx, qword [rsp + 0x50]
mov r9, rbp
mov r8d, 0x800
mov rcx, rsi
mov rdx, rbx
call sym.PeekConsoleInputA
test eax, eax
je 0x2100ca048
mov r8d, dword [rsp + 0x8c]
test r8d, r8d
je 0x2100ca048
mov r9, rbp
mov rdx, rbx
mov rcx, rsi
call sym.ReadConsoleInputA
mov rax, qword [rsp + 0xa180]
cmp byte [rax + 0x129], 0
jne 0x2100c9b28
mov edx, dword [rsp + 0x8c]
test edx, edx
je 0x2100ca080
mov r12, qword [rsp + 0x50]
xor r14d, r14d
xor ebx, ebx
xor r13d, r13d
jmp 0x2100c9bb6
add r14d, 1
add r12, 0x14
cmp dword [rsp + 0x8c], r14d
jbe 0x2100c9ca0
cmp word [r12], 1
jne 0x2100c9ba0
mov r9d, dword [r12 + 4]
test r9d, r9d
je 0x2100c9ba0
movzx eax, byte [r12 + 0xe]
mov edx, dword [r12 + 0x10]
test al, al
je 0x2100c9f18
and edx, 3
je 0x2100c9bf6
mov rax, qword [rsp + 0x58]
add ebx, 1
mov byte [rax + r13], 0x1b
movzx eax, byte [r12 + 0xe]
movsxd r13, ebx
mov rdi, qword [rsp + 0x58]
add ebx, 1
mov byte [rdi + r13], al
movsxd r13, ebx
jmp 0x2100c9ba0
mov r8d, dword [rsp + 0xa0]
test r8d, r8d
je 0x2100c9960
mov r14, rbx
jmp 0x2100c9a3b
cmp byte [rdi + 0xc8], 0
mov rcx, rbx
jne 0x2100c9c43
jmp 0x2100c9c73
mov byte [rcx], 0xd
mov rax, rcx
mov r8d, dword [rsp + 0xa0]
mov edx, 0xa
sub rax, rbx
sub r8, rax
call sym.msys_2.0.dll_memchr
mov rcx, rax
test rax, rax
jne 0x2100c9c40
jmp 0x2100c99c9
mov byte [rcx], 0xa
mov rax, rcx
mov r8d, dword [rsp + 0xa0]
mov edx, 0xd
sub rax, rbx
sub r8, rax
call sym.msys_2.0.dll_memchr
mov rcx, rax
test rax, rax
jne 0x2100c9c70
jmp 0x2100c99c9
mov r14, qword [rsp + 0x58]
mov edi, dword [rsp + 0x44]
cmp dword [rsp + 0x60], edi
je 0x2100c9d04
mov rcx, qword [rsp + 0x48]
call method.tmp_pathbuf.c_get__
mov qword [rsp + 0x28], r13
mov r9d, dword [rsp + 0x60]
mov r14, rax
mov ecx, dword [rsp + 0x44]
lea rax, [0x2102ff790]
mov r8, qword [rsp + 0x78]
mov qword [rsp + 0x30], rax
mov rdx, r14
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0xa0], 0x8000
mov qword [rsp + 0x20], rax
call sym.convert_mb_str_unsigned_int__char__unsigned_long__unsigned_int__char_const__unsigned_long___mbstate_t___clone_constprop0_
movsxd r13, dword [rsp + 0xa0]
mov rbx, r13
mov r8, r13
mov edx, 0xd
mov rcx, r14
mov r15, r14
call sym.msys_2.0.dll_memchr
mov r8, r13
mov edx, 0xa
mov rcx, r14
mov rdi, rax
call sym.msys_2.0.dll_memchr
mov r8d, ebx
mov r10, rax
mov rax, rdi
or rax, r10
je 0x2100c9e25
mov qword [rsp + 0x68], rsi
mov r12, r10
mov esi, ebx
mov rbx, r13
jmp 0x2100c9d93
lea r15, [r12 + 1]
mov r12, rbx
mov edx, 0xd
mov r13, r15
mov rcx, r15
sub r13, r14
sub r12, r13
mov r8, r12
call sym.msys_2.0.dll_memchr
mov r8, r12
mov edx, 0xa
mov rcx, r15
mov rdi, rax
call sym.msys_2.0.dll_memchr
mov r12, rax
mov rax, rdi
or rax, r12
je 0x2100c9e18
test rdi, rdi
je 0x2100c9dad
test r12, r12
je 0x2100c9e10
lea rax, [rdi + 1]
cmp r12, rax
je 0x2100c9dad
cmp r12, rdi
cmova r12, rdi
mov r8, r12
mov byte [r12], 0xa
sub r8, r15
add r8d, 1
mov dword [rsp + 0x8c], r8d
je 0x2100c9d50
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x90]
mov r9, rbp
mov rdx, r15
call sym.WriteFile
test eax, eax
je 0x2100c9d50
mov r8d, dword [rsp + 0x8c]
movzx eax, byte [rsp + 0x66]
movzx edi, byte [rsp + 0x67]
test r8d, r8d
cmovne eax, edi
mov byte [rsp + 0x66], al
jmp 0x2100c9d50
mov r12, rdi
jmp 0x2100c9dad
mov ebx, esi
mov rsi, qword [rsp + 0x68]
sub ebx, r13d
mov r8d, ebx
mov dword [rsp + 0x8c], r8d
test r8d, r8d
je 0x2100c9b28
mov qword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x90]
mov r9, rbp
mov rdx, r15
call sym.WriteFile
test eax, eax
je 0x2100c9b28
mov ecx, dword [rsp + 0x8c]
movzx eax, byte [rsp + 0x66]
movzx ebx, byte [rsp + 0x67]
test ecx, ecx
cmovne eax, ebx
mov byte [rsp + 0x66], al
jmp 0x2100c9b28
cmp dword [rsp + 0xa170], 1
je 0x2100ca058
cmp byte [rsp + 0x66], 0
jne 0x2100ca030
mov eax, dword [rsp + 0xa170]
mov edx, dword [rsp + 0x98]
mov byte [rdi + 0x129], 0
mov dword [rdi + 0x124], eax
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov dword [rax - 0x2cc8], edx
mov edx, dword [rsp + 0x9c]
mov rax, qword gs:[0x30]
mov rax, qword [rax + 8]
mov dword [rax - 0x2cc4], edx
cmp byte [rsp + 0xf8], 0
je 0x2100c9f01
cmp qword [rsp + 0x108], 0
je 0x2100c9f01
mov rcx, qword [rsp + 0x70]
call method.pinfo.release__
nop
add rsp, 0xa128
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp word [r12 + 0xa], 0x32
jne 0x2100c9f40
test dl, 0xc
je 0x2100c9f40
and edx, 3
jne 0x2100c9f40
mov rax, qword [rsp + 0x58]
add ebx, 1
mov byte [rax + r13], 0
movsxd r13, ebx
jmp 0x2100c9ba0
mov rdx, qword [rsp + 0x78]
mov rcx, r12
call method.fhandler_console.get_nonascii_key__INPUT_RECORD__char_
mov r15, rax
test rax, rax
je 0x2100c9ba0
mov rax, qword [rsp + 0x58]
mov rdx, r15
lea rcx, [rax + r13]
call sym.msys_2.0.dll_strcpy
mov rcx, r15
call sym.msys_2.0.dll_strlen
add ebx, eax
movsxd r13, ebx
jmp 0x2100c9ba0
mov rax, qword [0x21023d810]
movzx r9d, word [rdi + 0x10]
lea rbx, [rsp + 0x120]
lea rdx, str..pipemsys__S_pty_d_master_ctl
mov rcx, rbx
lea rbp, [rsp + 0x8c]
lea r8, [rax + 0x4210]
call sym.__small_sprintf
call sym.GetCurrentProcessId
mov dword [rsp + 0x30], 0x1f4
mov rdx, rbp
lea r9, [rsp + 0xa0]
mov dword [rsp + 0x8c], eax
lea rax, [rsp + 0x98]
mov r8d, 4
mov rcx, rbx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x38
mov qword [rsp + 0x48], rax
call sym.CallNamedPipeA
test eax, eax
je 0x2100c9ee1
mov rax, qword [rsp + 0xc8]
cmp dword [rsp + 0xa170], 1
cmove rax, qword [rsp + 0xc0]
mov qword [rsp + 0x90], rax
jmp 0x2100c98d3
mov rcx, qword [rsp + 0xa188]
call sym.SetEvent
jmp 0x2100c9e99
mov rdi, qword [rsp + 0xa180]
jmp 0x2100c9e8e
mov rcx, qword [rsp + 0xa188]
call sym.ResetEvent
jmp 0x2100c9e99
call sym.GetConsoleCP
mov dword [rsp + 0x44], eax
jmp 0x2100c9900
mov ebx, dword [rsp + 0x44]
cmp dword [rsp + 0x60], ebx
je 0x2100c9b28
xor r13d, r13d
jmp 0x2100c9caf