Function at 0x140022060
Capabilities:
Get socket status

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r13
push r14
push r15
lea rbp, [rsp - 0x578]
sub rsp, 0x678
xor edi, edi
mov r14d, r8d
mov esi, edx
mov r15, rcx
mov qword [rbp + 0x5c8], rdi
mov r13d, edi
test rcx, rcx
je 0x1400220b2
mov r9d, edi
test edx, edx
je 0x1400220b2
mov rax, rcx
cmp qword [rax], 0xffffffffffffffff
jne 0x1400220e2
inc r9d
add rax, 0x10
cmp r9d, esi
jb 0x1400220a0
test r8d, r8d
je 0x14002241b
jns 0x140022412
mov ecx, 0x2726
call qword [sym.imp.WSOCK32.DLL_WSASetLastError]
or edi, 0xffffffff
mov eax, edi
add rsp, 0x678
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbp
ret
mov qword [rsp + 0x6b8], rbx
mov qword [rsp + 0x670], r12
test r8d, r8d
jle 0x140022104
mov r13d, r8d
call fcn.140022870
mov rbx, rax
jmp 0x14002210b
mov rbx, qword [rbp + 0x5c8]
or r12, 0xffffffffffffffff
mov r10d, edi
mov dword [rsp + 0x40], edi
add r15, 8
mov r11d, edi
mov dword [rbp + 0x150], edi
mov r8d, edi
mov dword [rbp + 0x360], edi
mov qword [rsp + 0x30], rsi
mov rdx, qword [r15 - 8]
mov word [r15 + 2], di
cmp rdx, 0xffffffffffffffff
je 0x140022229
movzx r9d, word [r15]
test r9b, 7
je 0x140022229
cmp rdx, r12
cmova r12, rdx
test r9b, 1
je 0x140022195
mov ecx, edi
test r10d, r10d
je 0x140022176
mov eax, ecx
cmp qword [rsp + rax*8 + 0x48], rdx
je 0x140022176
inc ecx
cmp ecx, r10d
jb 0x140022166
cmp ecx, r10d
jne 0x140022195
cmp r10d, 0x40
jae 0x140022195
mov eax, ecx
mov qword [rsp + rax*8 + 0x48], rdx
mov r10d, dword [rsp + 0x40]
inc r10d
mov dword [rsp + 0x40], r10d
test r9b, 4
je 0x1400221db
mov ecx, edi
test r11d, r11d
je 0x1400221b5
mov eax, ecx
cmp qword [rbp + rax*8 + 0x158], rdx
je 0x1400221b5
inc ecx
cmp ecx, r11d
jb 0x1400221a2
cmp ecx, r11d
jne 0x1400221db
cmp r11d, 0x40
jae 0x1400221db
mov eax, ecx
mov qword [rbp + rax*8 + 0x158], rdx
mov r11d, dword [rbp + 0x150]
inc r11d
mov dword [rbp + 0x150], r11d
test r9b, 2
je 0x140022229
mov ecx, edi
test r8d, r8d
je 0x140022203
nop dword [rax + rax]
mov eax, ecx
cmp qword [rbp + rax*8 + 0x368], rdx
je 0x140022203
inc ecx
cmp ecx, r8d
jb 0x1400221f0
cmp ecx, r8d
jne 0x140022229
cmp r8d, 0x40
jae 0x140022229
mov eax, ecx
mov qword [rbp + rax*8 + 0x368], rdx
mov r8d, dword [rbp + 0x360]
inc r8d
mov dword [rbp + 0x360], r8d
add r15, 0x10
dec rsi
jne 0x140022131
test r10d, r10d
jne 0x140022288
test r11d, r11d
jne 0x140022288
test r8d, r8d
jne 0x140022288
test r14d, r14d
je 0x140022265
jns 0x14002225c
mov ecx, 0x2726
call qword [sym.imp.WSOCK32.DLL_WSASetLastError]
or edi, 0xffffffff
jmp 0x140022265
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_Sleep]
mov eax, edi
mov rbx, qword [rsp + 0x6b8]
mov r12, qword [rsp + 0x670]
add rsp, 0x678
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbp
ret
lea rsi, [rbp + 0x5c8]
test r14d, r14d
cmovs rsi, rdi
test r14d, r14d
jle 0x1400222cc
mov eax, 0x10624dd3
mov ecx, r13d
imul r13d
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [rbp + 0x5c8], edx
imul eax, edx, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov dword [rbp + 0x5cc], eax
jmp 0x1400222d5
jne 0x1400222d5
mov qword [rbp + 0x5c8], rdi
test r8d, r8d
lea r9, [rbp + 0x360]
lea r8, [rbp + 0x150]
cmove r9, rdi
test r11d, r11d
lea rdx, [rsp + 0x40]
cmove r8, rdi
test r10d, r10d
lea ecx, [r12 + 1]
cmove rdx, rdi
mov qword [rsp + 0x20], rsi
call qword [sym.imp.WSOCK32.DLL_select]
cmp eax, 0xffffffff
jne 0x14002237b
call qword [sym.imp.WSOCK32.DLL_WSAGetLastError]
test eax, eax
je 0x14002232b
cmp dword [0x14004f78c], edi
jne 0x14002237f
cmp eax, 0x2714
jne 0x14002237f
test r14d, r14d
jg 0x140022348
mov r10d, dword [rsp + 0x40]
mov r11d, dword [rbp + 0x150]
mov r8d, dword [rbp + 0x360]
jmp 0x140022296
call fcn.140022870
mov rdx, rbx
mov rcx, rax
call fcn.1400227e0
mov r13d, r14d
sub r13d, eax
test r13d, r13d
jle 0x140022389
mov r10d, dword [rsp + 0x40]
mov r11d, dword [rbp + 0x150]
mov r8d, dword [rbp + 0x360]
jmp 0x140022296
test eax, eax
jns 0x140022387
or eax, 0xffffffff
jmp 0x140022267
jne 0x140022390
xor eax, eax
jmp 0x140022267
mov rbx, qword [rbp + 0x5b0]
mov rax, qword [rsp + 0x30]
mov esi, edi
add rbx, 0xa
mov rcx, qword [rbx - 0xa]
mov word [rbx], di
cmp rcx, 0xffffffffffffffff
je 0x1400223fd
lea rdx, [rsp + 0x40]
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x1400223c1
or word [rbx], 1
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x150]
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x1400223d9
or word [rbx], 4
mov rcx, qword [rbx - 0xa]
lea rdx, [rbp + 0x360]
call sub.WSOCK32.DLL___WSAFDIsSet
test eax, eax
je 0x1400223f1
or word [rbx], 2
mov rax, qword [rsp + 0x30]
cmp word [rbx], di
je 0x1400223fd
inc esi
add rbx, 0x10
dec rax
mov qword [rsp + 0x30], rax
jne 0x1400223a2
mov eax, esi
jmp 0x140022267
mov ecx, r8d
call qword [sym.imp.KERNEL32.dll_Sleep]
mov eax, edi
add rsp, 0x678
pop r15
pop r14
pop r13
pop rdi
pop rsi
pop rbp
ret