Function at 0x1402135a0
Capabilities:
Get socket status

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x648
test rcx, rcx
je 0x1402135e0
mov edi, edx
test edx, edx
je 0x1402135e0
mov rsi, rcx
mov eax, edi
mov rcx, rax
shl rcx, 4
xor edx, edx
nop dword [rax]
cmp qword [rsi + rdx], 0xffffffffffffffff
jne 0x140213608
add rdx, 0x10
cmp rcx, rdx
jne 0x1402135d0
xor ebx, ebx
test r8, r8
je 0x1402138d9
js 0x140213751
mov ecx, 0xfffffffe
cmp r8, rcx
cmovl rcx, r8
call qword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x1402138d9
xor edx, edx
xor ecx, ecx
xor r15d, r15d
xor ebp, ebp
jmp 0x14021362c
inc rdx
cmp rdx, rax
je 0x140213730
mov r10, rdx
shl r10, 4
mov word [rsi + r10 + 0xa], 0
mov r9, qword [rsi + r10]
cmp r9, 0xffffffffffffffff
je 0x140213620
movzx r10d, word [rsi + r10 + 8]
test r10d, 0x710
je 0x140213620
test r10d, 0x300
je 0x140213698
mov r11d, ecx
xor ebx, ebx
test ecx, ecx
je 0x140213685
nop word cs:[rax + rax]
cmp qword [rsp + rbx*8 + 0x448], r9
je 0x140213685
inc rbx
cmp r11, rbx
jne 0x140213670
mov ebx, r11d
cmp ebx, ecx
jne 0x140213698
cmp ecx, 0x3f
ja 0x140213698
mov qword [rsp + r11*8 + 0x448], r9
inc ecx
test r10b, 0x10
je 0x1402136db
mov r11d, r15d
xor ebx, ebx
test r15d, r15d
je 0x1402136c5
nop dword [rax + rax]
cmp qword [rsp + rbx*8 + 0x240], r9
je 0x1402136c5
inc rbx
cmp r11, rbx
jne 0x1402136b0
mov ebx, r11d
cmp ebx, r15d
jne 0x1402136db
cmp r15d, 0x3f
ja 0x1402136db
mov qword [rsp + r11*8 + 0x240], r9
inc r15d
test r10d, 0x600
je 0x140213620
mov r10d, ebp
xor r11d, r11d
test ebp, ebp
je 0x140213712
nop word cs:[rax + rax]
cmp qword [rsp + r11*8 + 0x38], r9
je 0x140213712
inc r11
cmp r10, r11
jne 0x140213700
mov r11d, r10d
cmp r11d, ebp
jne 0x140213620
cmp ebp, 0x3f
ja 0x140213620
mov qword [rsp + r10*8 + 0x38], r9
inc ebp
jmp 0x140213620
mov dword [rsp + 0x440], ecx
mov dword [rsp + 0x238], r15d
mov dword [rsp + 0x30], ebp
test ecx, ecx
je 0x140213766
lea r14, [rsp + 0x440]
jmp 0x1402137a1
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov ebx, 0xffffffff
jmp 0x1402138d9
xor ebx, ebx
mov eax, r15d
or eax, ebp
jne 0x14021379e
test r8, r8
je 0x1402138c2
js 0x1402138ef
mov ecx, 0xfffffffe
cmp r8, rcx
cmovl rcx, r8
call qword [sym.imp.KERNEL32.DLL_Sleep]
cmp ebx, 0xffffffff
jne 0x1402138d9
jmp 0x1402138c7
xor r14d, r14d
lea rcx, [rsp + 0x28]
mov rdx, r8
call fcn.14024d320
xor ebx, ebx
test r15d, r15d
lea r8, [rsp + 0x238]
cmove r8, rbx
test ebp, ebp
lea r9, [rsp + 0x30]
cmove r9, rbx
mov qword [rsp + 0x20], rax
xor ecx, ecx
mov rdx, r14
call qword [sym.imp.WS2_32.dll_select]
test eax, eax
jle 0x1402138c0
cmp edi, 2
mov r12d, 1
cmovae r12d, edi
shl r12, 4
lea rdi, [rsp + 0x440]
lea r14, [rsp + 0x238]
lea r15, [rsp + 0x30]
xor r13d, r13d
jmp 0x140213827
cmp word [rsi + r13 + 0xa], 1
sbb ebx, 0xffffffff
add r13, 0x10
cmp r12, r13
je 0x1402138d9
mov word [rsi + r13 + 0xa], 0
mov rcx, qword [rsi + r13]
cmp rcx, 0xffffffffffffffff
je 0x14021381a
mov rdx, rdi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140213865
movzx eax, word [rsi + r13 + 8]
test eax, 0x100
je 0x140213858
or byte [rsi + r13 + 0xb], 1
test eax, 0x300
je 0x140213865
or byte [rsi + r13 + 0xb], 3
mov rcx, qword [rsi + r13]
mov rdx, r14
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140213883
test byte [rsi + r13 + 8], 0x10
je 0x140213883
or byte [rsi + r13 + 0xa], 0x10
mov rcx, qword [rsi + r13]
mov rdx, r15
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x140213810
movzx eax, word [rsi + r13 + 8]
test eax, 0x200
je 0x1402138aa
or byte [rsi + r13 + 0xb], 2
test eax, 0x400
je 0x140213810
or byte [rsi + r13 + 0xb], 4
jmp 0x140213810
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x1402138d9
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
xor ebx, ebx
cmp eax, 0x2714
setne bl
neg ebx
mov eax, ebx
add rsp, 0x648
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, 0x2726
call qword [sym.imp.WS2_32.dll_WSASetLastError]
mov ebx, 0xffffffff
cmp ebx, 0xffffffff
jne 0x1402138d9
jmp 0x1402138c7