Function at 0x140041580
Capabilities:
Send data
Send data on socket
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r14
push r15
sub rsp, 0x90
movsxd rbp, ecx
mov rsi, r8
lea rcx, [0x14027dfa0]
mov r14, rdx
xor edi, edi
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea r15, [rbp*8]
lea rcx, [0x14027dfa0]
mov rbx, qword [r15 + rax]
call sub.KERNEL32.dll_LeaveCriticalSection
mov r8d, dword [rbx + 0x68]
test r8b, 0x28
je 0x14004185b
bt r8d, 0x10
jb 0x14004186d
test rsi, rsi
je 0x140041764
test r8b, 8
je 0x14004163f
test r8b, r8b
js 0x140041889
mov ecx, dword [rbx + 0x70]
call fcn.14017f368
mov rcx, rax
lea r9, [rsp + 0xb0]
mov qword [rsp + 0x20], rdi
mov r8d, esi
mov rdx, r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
or ecx, 0xffffffff
test eax, eax
cmovne ecx, dword [rsp + 0xb0]
call fcn.140171260
mov edi, eax
jmp 0x140041847
test r8b, 1
je 0x14004171d
cmp qword [rbx + 0x40], rdi
je 0x1400416a9
cmp dword [rbx + 0x2c], edi
jne 0x1400416a9
lea rcx, [0x14027dfa0]
call sub.KERNEL32.dll_EnterCriticalSection
mov rax, qword [0x14027e020]
lea rcx, [0x14027dfa0]
mov rdi, qword [r15 + rax]
call sub.KERNEL32.dll_LeaveCriticalSection
cmp dword [rdi + 0x2c], 0
jne 0x1400416a9
cmp dword [0x14027df78], 0
jne 0x1400416a9
lea rdx, [rsp + 0x30]
mov ecx, ebp
call fcn.140044040
test eax, eax
jne 0x1400416a9
cmp dword [rdi + 0x2c], eax
jne 0x1400416a9
mov eax, dword [rsp + 0x4c]
mov dword [rdi + 0x28], eax
mov dword [rdi + 0x2c], 1
movsxd rcx, dword [rbx + 0x70]
xor r9d, r9d
mov r8d, esi
mov rdx, r14
call qword [sym.imp.WS2_32.dll_send]
movsxd rcx, eax
call fcn.140171260
mov edi, eax
test eax, eax
jns 0x140041847
mov rax, qword gs:[0x58]
mov edx, 0x2f80
mov rcx, qword [rax]
mov rax, qword [rdx + rcx]
test rax, rax
jne 0x1400416ed
call fcn.1401762d4
cmp dword [rax], 0x2747
jne 0x140041847
cmp rsi, 0x400
jbe 0x140041847
shr rsi, 1
mov rdx, r14
mov r8, rsi
mov ecx, ebp
call fcn.140041580
mov edi, eax
jmp 0x140041847
test r8b, 4
je 0x14004189b
test r8b, r8b
js 0x140041735
movsxd rcx, dword [rbx + 0x70]
jmp 0x14004160d
bt r8d, 0x1a
jae 0x140041784
mov rax, qword gs:[0x58]
mov edx, 0x2f80
mov rcx, qword [rax]
mov rax, qword [rdx + rcx]
test rax, rax
jne 0x14004175b
call fcn.1401762d4
mov dword [rax], 0x20
or edi, 0xffffffff
lea r11, [rsp + 0x90]
movsxd rax, edi
mov rbx, qword [r11 + 0x28]
mov rbp, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rdi
ret
mov rcx, qword [rbx + 0x88]
call fcn.14005a520
mov ecx, eax
mov edx, esi
cmp rcx, rsi
cmovb edx, eax
movsxd rdi, edx
test edx, edx
jne 0x1400417c8
mov rax, qword gs:[0x58]
mov edx, 0x2f80
mov rcx, qword [rax]
mov rax, qword [rdx + rcx]
test rax, rax
jne 0x1400417c0
call fcn.1401762d4
mov dword [rax], 0x2733
jmp 0x140041761
mov rcx, qword [rbx + 0x88]
mov r8d, edi
mov rdx, r14
call fcn.14005a720
mov rcx, qword [rbx + 0x88]
call fcn.14005a520
and dword [rbx + 0x68], 0xffff7fff
mov ecx, eax
neg ecx
sbb edx, edx
and edx, 0x8000
or dword [rbx + 0x68], edx
test eax, eax
je 0x140041808
mov rcx, rbx
call fcn.140049020
cmp rdi, rsi
je 0x140041832
mov rax, qword gs:[0x58]
mov edx, 0x2f80
mov rcx, qword [rax]
mov rax, qword [rdx + rcx]
test rax, rax
jne 0x14004182c
call fcn.1401762d4
mov dword [rax], 0x2733
mov rcx, rbx
call fcn.1400444b0
test dword [rbx + 0x68], 0x4000000
jne 0x140041761
test edi, edi
jle 0x140041764
movsxd rax, edi
add qword [rbx + 0x18], rax
jmp 0x140041764
lea rdx, str.write_to_non_streamfile_socket
mov ecx, 0x4b0000
call fcn.14002d920
int3
mov r9d, dword [rbx + 0x180]
lea rdx, str.sock_write_fd_d_with_ASSERT_CLOSE:__x
mov r8d, ebp
mov ecx, 0x4b0000
call fcn.14002d920
int3
lea rdx, str.vsock_type_file_does_not_support_non_blocking_mode
mov ecx, 0x4b
call fcn.140028d40
int3
lea rdx, str.invalid_fd_type_0x_x
mov ecx, 0x4b0000
call fcn.14002d920
int3