Function at 0x140018a70
Capabilities:
Read file on windows
Read pipe

Disassembly:
mov r11, rsp
push rbp
push rbx
push r14
lea rbp, [r11 - 0x238]
sub rsp, 0x320
mov rax, qword [0x140067020]
xor rax, rsp
mov qword [rbp + 0x1f0], rax
and dword [rdx + 0x58], 0xfffdffff
mov rbx, rdx
mov qword [r11 - 0x20], rsi
mov r14, rcx
mov qword [r11 - 0x28], rdi
mov rsi, r8
mov rdi, qword [rdx + 0x128]
test rdi, rdi
je 0x140018ae8
test byte [rdi + 0x58], 0x40
je 0x140018ae8
mov rcx, qword [rdi + 8]
mov rdx, rdi
add rcx, 0x58
call fcn.1400163d0
mov eax, dword [rdi + 0x58]
test al, 0x40
je 0x140018ae8
and eax, 0xffffffbf
mov dword [rdi + 0x58], eax
test al, 0x20
je 0x140018ae8
mov rax, qword [rdi + 8]
dec dword [rax + 8]
mov ecx, dword [rsi + 0x40]
movaps xmmword [rsp + 0x300], xmm6
test ecx, ecx
jns 0x140018bb0
test dword [rbx + 0x58], 0x100
je 0x140018dac
movups xmm6, xmmword [0x14005c870]
call qword [0x14006aa88]
mov esi, eax
cmp eax, 0x3e3
je 0x140018dac
mov rcx, qword [rbx + 0x128]
movdqa xmmword [rsp + 0x40], xmm6
cmp eax, 0x6d
jne 0x140018b74
test rcx, rcx
je 0x140018b4e
lea rdx, [0x1400193a0]
call fcn.1400110a0
xor edi, edi
mov qword [rbx + 0x128], rdi
and dword [rbx + 0x58], 0xffff7fff
mov rcx, rbx
call fcn.140011460
lea r8, [rsp + 0x40]
mov rdx, 0xfffffffffffff001
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x140018dac
test rcx, rcx
je 0x140018b8e
lea rdx, [0x1400193a0]
call fcn.1400110a0
xor edi, edi
mov qword [rbx + 0x128], rdi
mov rcx, rbx
call fcn.140011460
mov ecx, esi
call fcn.140016b80
movsxd rdx, eax
lea r8, [rsp + 0x40]
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x140018dac
test dword [rbx + 0x58], 0x100
je 0x140018d92
xor edi, edi
nop
mov rcx, qword [rbx + 0x118]
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rdi
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
test eax, eax
je 0x140018d66
mov ecx, dword [rsp + 0x30]
test ecx, ecx
je 0x140018d92
cmp dword [rbx + 0x110], edi
je 0x140018cb1
cmp qword [rbx + 0x1e8], rdi
jne 0x140018ca2
mov rcx, qword [rbx + 0x118]
lea r9, [rsp + 0x34]
mov r8d, select
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140018d66
mov eax, dword [rsp + 0x60]
test al, 2
je 0x140018c87
mov rcx, qword [rbx + 0x118]
lea r9, [rsp + 0x34]
mov r8d, 0x278
mov qword [rsp + 0x20], rdi
lea rdx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140018d66
mov r8d, dword [rsp + 0x60]
lea rdx, [rsp + 0x70]
and r8d, 4
mov rcx, rbx
call fcn.140018950
mov eax, dword [rsp + 0x60]
test al, 1
je 0x140018c9c
mov rax, qword [rsp + 0x68]
mov qword [rbx + 0x1e8], rax
jmp 0x140018d36
mov ecx, dword [rsp + 0x30]
jmp 0x140018cb1
mov eax, dword [rbx + 0x1e8]
cmp ecx, eax
cmovae ecx, eax
mov dword [rsp + 0x30], ecx
mov edx, ecx
lea r8, [rsp + 0x50]
mov qword [rsp + 0x48], rdi
mov rcx, rbx
mov dword [rsp + 0x40], edi
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0x50], xmm0
call qword [rbx + 0x68]
mov rdx, qword [rsp + 0x58]
test rdx, rdx
je 0x140018d52
mov eax, dword [rsp + 0x50]
test eax, eax
je 0x140018d52
mov r8d, dword [rsp + 0x30]
lea r9, [rsp + 0x34]
mov rcx, qword [rbx + 0x118]
cmp eax, r8d
mov qword [rsp + 0x20], rdi
cmovb r8d, eax
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140018d45
mov ecx, dword [rsp + 0x34]
cmp dword [rbx + 0x110], edi
je 0x140018d1e
sub qword [rbx + 0x1e8], rcx
mov rdx, rcx
lea r8, [rsp + 0x50]
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
mov eax, dword [rsp + 0x50]
cmp dword [rsp + 0x34], eax
jbe 0x140018d92
test dword [rbx + 0x58], 0x100
jne 0x140018bc0
jmp 0x140018d92
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rsp + 0x40], xmm0
jmp 0x140018d72
lea r8, [rsp + 0x50]
mov rdx, 0xfffffffffffff024
mov rcx, rbx
call qword [rbx + reloc.WS2_32.dll_WSASetLastError]
jmp 0x140018d92
movups xmm0, xmmword [0x14005c870]
movaps xmmword [rsp + 0x40], xmm0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e3
je 0x140018d92
lea r9, [rsp + 0x40]
mov r8d, eax
mov rdx, rbx
mov rcx, r14
call fcn.1400188b0
mov eax, dword [rbx + 0x58]
and eax, 0x20100
cmp eax, 0x100
jne 0x140018dac
mov rdx, rbx
mov rcx, r14
call fcn.140018640
mov ecx, dword [rbx + 0x78]
mov eax, dword [rbx + 0x58]
dec ecx
movaps xmm6, xmmword [rsp + 0x300]
mov rdi, qword [rsp + 0x310]
mov rsi, qword [rsp + 0x318]
mov dword [rbx + 0x78], ecx
test al, 1
je 0x140018ded
test ecx, ecx
jne 0x140018ded
test al, 8
jne 0x140018ded
or eax, 8
mov dword [rbx + 0x58], eax
mov rax, qword [r14 + 0x50]
mov qword [rbx + 0x50], rax
mov qword [r14 + 0x50], rbx
mov rcx, qword [rbp + 0x1f0]
xor rcx, rsp
call fcn.14001bfd0
add rsp, 0x320
pop r14
pop rbx
pop rbp
ret