Function at 0x140040ff0
Capabilities:
Read file on windows
Read pipe
Receive data
Receive data on socket

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push r12
push r14
push r15
sub rsp, 0x30
movsxd rbx, ecx
mov rbp, r8
lea rcx, [0x14027dfa0]
mov r14, rdx
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rsi, qword [rax + rbx*8]
call sub.KERNEL32.dll_LeaveCriticalSection
mov r8d, dword [rsi + 0x68]
xor r12d, r12d
mov ebx, r12d
mov r15d, r12d
test r8b, 0x28
je 0x1400412e5
mov qword [rsp + 0x70], rdi
test r8b, 8
je 0x1400410e7
mov ecx, dword [rsi + 0x70]
call fcn.14017f118
mov rcx, rax
mov qword [rsp + 0x20], r12
lea r9, [rsp + 0x60]
mov r8d, ebp
mov rdx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
movsxd rcx, eax
call fcn.140171010
mov ecx, dword [rsp + 0x60]
test rax, rax
jne 0x1400410e0
test ecx, ecx
jne 0x1400410e0
mov rax, qword gs:[0x58]
mov edi, 0x2f80
add rdi, qword [rax]
mov rax, qword [rdi]
test rax, rax
jne 0x1400410a7
call fcn.140176084
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f940
test eax, eax
jne 0x1400412cb
mov rax, qword [rdi]
test rax, rax
jne 0x1400410d2
call fcn.140176084
mov dword [rax], 0x2733
or ebx, 0xffffffff
jmp 0x1400412cb
mov ebx, ecx
jmp 0x1400412c0
test r8b, 1
je 0x140041150
movsxd rcx, dword [rsi + 0x70]
xor r9d, r9d
mov r8d, ebp
mov rdx, r14
call qword [sym.imp.WS2_32.dll_recv]
movsxd rcx, eax
call fcn.140171010
mov rbx, rax
test rbp, rbp
jne 0x1400412c0
cmp eax, 0xffffffff
jne 0x1400412c0
mov rcx, qword gs:[0x58]
mov edi, 0x2f80
mov rdx, qword [rcx]
mov rax, qword [rdi + rdx]
test rax, rax
jne 0x14004113c
call fcn.140176084
cmp dword [rax], 0x2733
jne 0x1400412cb
mov ebx, r12d
jmp 0x1400412cb
test r8b, 4
je 0x140041309
bt r8d, 9
jae 0x1400411f5
movzx eax, byte [rsi + 0x164]
mov ebx, 1
mov byte [r14], al
and dword [rsi + 0x68], 0xffffbdff
inc r14
sub rbp, 1
je 0x1400412c4
movsxd rcx, dword [rsi + 0x70]
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], r12
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_PeekNamedPipe]
movsxd rcx, eax
call fcn.140171010
mov edi, 0x2f80
test rax, rax
jne 0x14004123a
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov rax, qword [rdi + rcx]
test rax, rax
jne 0x1400411d5
call fcn.140176084
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f940
test eax, eax
je 0x1400412f7
jmp 0x14004122d
bt r8d, 0xa
jae 0x140041188
mov edi, 0x2f80
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov rax, qword [rdi + rcx]
test rax, rax
jne 0x1400410d2
call fcn.140176084
or ebx, 0xffffffff
mov dword [rax], 0x2733
jmp 0x1400412cb
mov dword [rsp + 0x68], r12d
mov r15d, 1
jmp 0x140041241
cmp dword [rsp + 0x68], r12d
jne 0x140041257
test byte [rsi + 0x68], 0x80
jne 0x14004124c
test r15d, r15d
je 0x140041257
test ebx, ebx
jne 0x1400412c2
test r15d, r15d
jne 0x1400412cb
jmp 0x140041201
movsxd rcx, dword [rsi + 0x70]
lea r9, [rsp + 0x60]
mov r8d, ebp
mov qword [rsp + 0x20], r12
mov rdx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
movsxd rcx, eax
call fcn.140171010
mov ecx, dword [rsp + 0x60]
test rax, rax
jne 0x1400412be
test ecx, ecx
jne 0x1400412be
mov rax, qword gs:[0x58]
add rdi, qword [rax]
mov rax, qword [rdi]
test rax, rax
jne 0x14004129f
call fcn.140176084
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f940
test eax, eax
jne 0x1400412c0
jmp 0x1400410c5
add ebx, ecx
test ebx, ebx
jle 0x1400412cb
movsxd rax, ebx
add qword [rsi + 0x20], rax
mov rdi, qword [rsp + 0x70]
movsxd rax, ebx
mov rbx, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r12
pop rsi
pop rbp
ret
lea rdx, str.read_from_non_streamfile_socket
mov ecx, 0x4b0000
call fcn.14002d6c0
int3
lea rdx, str.PeekNamedPipe_failed:__m
mov ecx, 0x4b0000
call fcn.14002d6c0
int3
lea rdx, str.invalid_vsock_type__d
mov ecx, 0x4b0000
call fcn.14002d6c0
int3