Function at 0x1400182c0
Capabilities:
Get socket status
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push rsi
sub rsp, 0x490
mov rax, qword [0x140306028]
xor rax, rsp
mov qword [rsp + 0x460], rax
cmp dword [rcx + 0x58], 1
mov r8d, edx
mov rsi, rcx
jne 0x140018331
test edx, edx
jle 0x1400186a0
mov eax, 0x10624dd3
xor r9d, r9d
mul r8d
xor ecx, ecx
shr edx, 6
imul eax, edx, 0x3e8
mov dword [rsp + 0x30], edx
xor edx, edx
sub r8d, eax
imul eax, r8d, 0x3e8
xor r8d, r8d
mov dword [rsp + 0x34], eax
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
jmp 0x1400186a0
mov qword [rsp + 0x4b0], rbx
mov qword [rsp + 0x488], rbp
mov qword [rsp + 0x480], rdi
mov qword [rsp + 0x478], r14
mov qword [rsp + 0x470], r15
test r8d, r8d
je 0x1400183e9
mov ecx, r8d
mov dword [rsp + 0x250], 1
xor r9d, r9d
mov eax, 0x10624dd3
imul r8d
mov dword [rsp + 0x40], r9d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
imul eax, edx, 0x3e8
mov dword [rsp + 0x30], edx
mov rdx, qword [rsi + 0x28]
sub ecx, eax
imul eax, ecx, 0x3e8
mov rcx, qword [rsi + 0x50]
mov qword [rsp + 0x258], rcx
mov dword [rsp + 0x34], eax
sub rdx, qword [rsi + 0x20]
je 0x1400183c3
mov qword [rsp + 0x48], rcx
mov dword [rsp + 0x40], 1
test r8d, r8d
lea rax, [rsp + 0x30]
lea r8, [rsp + 0x40]
cmovle rax, r9
lea rdx, [rsp + 0x250]
inc ecx
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_select]
mov r15, rsi
nop dword [rax]
mov ebp, dword [rsi + 0x10]
sub ebp, dword [rsi + 8]
mov r14, qword [rsi + 0x10]
mov rdx, qword [rsi + 8]
mov rcx, r14
sub rcx, rdx
lea eax, [rbp + 0x5dc]
movsxd rdi, eax
cmp rdi, rcx
jae 0x140018418
lea rax, [rdi + rdx]
jmp 0x140018448
jbe 0x14001844c
mov rax, qword [rsi + 0x18]
sub rax, rdx
cmp rdi, rax
jbe 0x140018434
mov rdx, rdi
lea rcx, [rsi + 8]
call fcn.140211760
jmp 0x14001844c
sub rdi, rcx
xor edx, edx
mov r8, rdi
mov rcx, r14
call sub.VCRUNTIME140.dll_memset
lea rax, [rdi + r14]
mov qword [rsi + 0x10], rax
mov rdx, qword [rsi + 8]
xor r9d, r9d
mov rcx, qword [r15 + 0x50]
mov r8d, 0x5dc
movsxd rdi, ebp
add rdx, rdi
call qword [sym.imp.WS2_32.dll_recv]
mov r14d, eax
test eax, eax
jns 0x14001848a
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x1400184fa
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x1400184fa
mov rdx, qword [rsi + 8]
test r14d, r14d
jle 0x140018554
lea eax, [r14 + rbp]
mov rbp, qword [rsi + 0x10]
mov rcx, rbp
movsxd rdi, eax
sub rcx, rdx
cmp rdi, rcx
jae 0x1400184ba
lea rax, [rdi + rdx]
mov qword [rsi + 0x10], rax
jmp 0x1400183f0
jbe 0x1400183f0
mov rax, qword [rsi + 0x18]
sub rax, rdx
cmp rdi, rax
jbe 0x1400184dd
mov rdx, rdi
lea rcx, [rsi + 8]
call fcn.140211760
jmp 0x1400183f0
sub rdi, rcx
xor edx, edx
mov r8, rdi
mov rcx, rbp
call sub.VCRUNTIME140.dll_memset
lea rax, [rdi + rbp]
mov qword [rsi + 0x10], rax
jmp 0x1400183f0
mov rbp, qword [rsi + 0x10]
mov rdx, qword [rsi + 8]
mov rcx, rbp
sub rcx, rdx
cmp rdi, rcx
jae 0x14001851a
lea rax, [rdi + rdx]
mov qword [rsi + 0x10], rax
jmp 0x1400185ae
jbe 0x1400185ae
mov rax, qword [rsi + 0x18]
sub rax, rdx
cmp rdi, rax
jbe 0x14001853a
mov rdx, rdi
lea rcx, [rsi + 8]
call fcn.140211760
jmp 0x1400185ae
sub rdi, rcx
xor edx, edx
mov r8, rdi
mov rcx, rbp
call sub.VCRUNTIME140.dll_memset
lea rax, [rdi + rbp]
mov qword [rsi + 0x10], rax
jmp 0x1400185ae
mov rbp, qword [rsi + 0x10]
mov rcx, rbp
sub rcx, rdx
cmp rdi, rcx
jae 0x140018569
lea rax, [rdi + rdx]
jmp 0x140018599
jbe 0x14001859d
mov rax, qword [rsi + 0x18]
sub rax, rdx
cmp rdi, rax
jbe 0x140018585
mov rdx, rdi
lea rcx, [rsi + 8]
call fcn.140211760
jmp 0x14001859d
sub rdi, rcx
xor edx, edx
mov r8, rdi
mov rcx, rbp
call sub.VCRUNTIME140.dll_memset
lea rax, [rdi + rbp]
mov qword [rsi + 0x10], rax
mov rcx, qword [r15 + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rsi + 0x58], 1
mov rdx, qword [rsi + 0x28]
mov r8, qword [rsi + 0x20]
mov r14, qword [rsp + 0x478]
mov rbp, qword [rsp + 0x488]
cmp rdx, r8
je 0x140018667
mov rcx, r8
nop dword [rax]
nop word [rax + rax]
sub edx, r8d
xor r9d, r9d
mov r8d, edx
mov rdx, rcx
mov rcx, qword [r15 + 0x50]
call qword [sym.imp.WS2_32.dll_send]
movsxd rbx, eax
test eax, eax
jns 0x140018617
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x140018667
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2734
je 0x140018667
test ebx, ebx
jle 0x140018656
mov rdi, qword [rsi + 0x20]
lea rdx, [rdi + rbx]
cmp rdi, rdx
je 0x140018642
mov rbx, qword [rsi + 0x28]
mov rcx, rdi
sub rbx, rdx
mov r8, rbx
call sub.VCRUNTIME140.dll_memmove
lea rax, [rbx + rdi]
mov qword [rsi + 0x28], rax
mov rax, qword [rsi + 0x28]
mov rcx, qword [rsi + 0x20]
mov edx, eax
mov r8d, ecx
cmp rax, rcx
jne 0x1400185e0
jmp 0x140018667
mov rcx, qword [r15 + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rsi + 0x58], 1
mov rax, qword [rsi + 0x28]
mov rdi, qword [rsp + 0x480]
mov rbx, qword [rsp + 0x4b0]
cmp rax, qword [rsi + 0x20]
jne 0x140018698
cmp dword [rsi + 0x58], 0
jne 0x140018698
mov rcx, qword [r15 + 0x50]
call qword [sym.imp.WS2_32.dll_closesocket]
mov dword [rsi + 0x58], 1
mov r15, qword [rsp + 0x470]
mov rcx, qword [rsp + 0x460]
xor rcx, rsp
call fcn.140222170
add rsp, 0x490
pop rsi
ret