Function at 0x140041050
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 0x140041345
mov qword [rsp + 0x70], rdi
test r8b, 8
je 0x140041147
mov ecx, dword [rsi + 0x70]
call fcn.14017f178
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.140171070
mov ecx, dword [rsp + 0x60]
test rax, rax
jne 0x140041140
test ecx, ecx
jne 0x140041140
mov rax, qword gs:[0x58]
mov edi, 0x2f80
add rdi, qword [rax]
mov rax, qword [rdi]
test rax, rax
jne 0x140041107
call fcn.1401760e4
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f9a0
test eax, eax
jne 0x14004132b
mov rax, qword [rdi]
test rax, rax
jne 0x140041132
call fcn.1401760e4
mov dword [rax], 0x2733
or ebx, 0xffffffff
jmp 0x14004132b
mov ebx, ecx
jmp 0x140041320
test r8b, 1
je 0x1400411b0
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.140171070
mov rbx, rax
test rbp, rbp
jne 0x140041320
cmp eax, 0xffffffff
jne 0x140041320
mov rcx, qword gs:[0x58]
mov edi, 0x2f80
mov rdx, qword [rcx]
mov rax, qword [rdi + rdx]
test rax, rax
jne 0x14004119c
call fcn.1401760e4
cmp dword [rax], 0x2733
jne 0x14004132b
mov ebx, r12d
jmp 0x14004132b
test r8b, 4
je 0x140041369
bt r8d, 9
jae 0x140041255
movzx eax, byte [rsi + 0x164]
mov ebx, 1
mov byte [r14], al
and dword [rsi + 0x68], 0xffffbdff
inc r14
sub rbp, 1
je 0x140041324
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.140171070
mov edi, 0x2f80
test rax, rax
jne 0x14004129a
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov rax, qword [rdi + rcx]
test rax, rax
jne 0x140041235
call fcn.1401760e4
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f9a0
test eax, eax
je 0x140041357
jmp 0x14004128d
bt r8d, 0xa
jae 0x1400411e8
mov edi, 0x2f80
mov rax, qword gs:[0x58]
mov rcx, qword [rax]
mov rax, qword [rdi + rcx]
test rax, rax
jne 0x140041132
call fcn.1401760e4
or ebx, 0xffffffff
mov dword [rax], 0x2733
jmp 0x14004132b
mov dword [rsp + 0x68], r12d
mov r15d, 1
jmp 0x1400412a1
cmp dword [rsp + 0x68], r12d
jne 0x1400412b7
test byte [rsi + 0x68], 0x80
jne 0x1400412ac
test r15d, r15d
je 0x1400412b7
test ebx, ebx
jne 0x140041322
test r15d, r15d
jne 0x14004132b
jmp 0x140041261
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.140171070
mov ecx, dword [rsp + 0x60]
test rax, rax
jne 0x14004131e
test ecx, ecx
jne 0x14004131e
mov rax, qword gs:[0x58]
add rdi, qword [rax]
mov rax, qword [rdi]
test rax, rax
jne 0x1400412ff
call fcn.1401760e4
mov ecx, dword [rax]
mov edx, 2
mov r9d, 0xe8
lea r8d, [rdx + 0x6b]
call fcn.14003f9a0
test eax, eax
jne 0x140041320
jmp 0x140041125
add ebx, ecx
test ebx, ebx
jle 0x14004132b
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.14002d720
int3
lea rdx, str.PeekNamedPipe_failed:__m
mov ecx, 0x4b0000
call fcn.14002d720
int3
lea rdx, str.invalid_vsock_type__d
mov ecx, 0x4b0000
call fcn.14002d720
int3