Function at 0x180021020
Capabilities:
Get socket status

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rdi
push r15
lea rbp, [rsp - 0xbf90]
mov eax, 0xc090
call fcn.180043b00
sub rsp, rax
mov rax, qword [0x180084088]
xor rax, rsp
mov qword [rbp + 0xbf80], rax
movzx eax, byte [rcx + 0x178]
xor edi, edi
mov qword [rsp + 0x30], rdi
mov rbx, rcx
lea r15d, [rdi + 1]
test al, al
je 0x18002106f
xor eax, eax
jmp 0x18002123e
test dword [rbx + 0x194], 0x2000
mov ecx, edi
mov qword [rsp + 0xc0c0], r14
mov r14d, edi
mov dword [rsp + 0x50], ecx
mov dword [rbp + 0x7f70], edi
mov dword [rbp + 0x3f60], edi
mov qword [rsp + 0x38], 0xffffffffffffffff
je 0x1800210bf
mov rcx, rbx
call fcn.180020300
mov ecx, dword [rsp + 0x50]
cmp eax, r15d
jne 0x1800210bf
movzx eax, byte [rbx + 0x194]
and al, 4
cmove r15d, edi
mov eax, dword [rbx + 0x194]
and eax, 4
mov qword [rsp + 0xc0b8], rsi
test al, al
jne 0x18002119d
movzx eax, byte [rbx + 0x178]
test al, al
jne 0x18002110c
lea rax, [rsp + 0x38]
mov rcx, rbx
lea r9, [rbp + 0x3f60]
mov qword [rsp + 0x20], rax
lea r8, [rbp + 0x7f70]
lea rdx, [rsp + 0x50]
call fcn.18001eac0
test eax, eax
jne 0x180021121
lea rdx, str.Could_not_obtain_daemon_fdsets
mov rcx, rbx
call fcn.180029dd0
mov r14d, 1
mov ecx, dword [rsp + 0x50]
mov rsi, qword [rbx + 0x168]
cmp rsi, 0xffffffffffffffff
je 0x180021351
lea rax, [rsp + 0x50]
test rax, rax
je 0x180021261
cmp ecx, 0x800
jb 0x180021166
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
mov ecx, dword [rsp + 0x50]
test eax, eax
je 0x180021261
mov edx, edi
test ecx, ecx
je 0x18002117f
nop dword [rax]
mov eax, edx
cmp rsi, qword [rsp + rax*8 + 0x58]
je 0x18002117f
inc edx
cmp edx, ecx
jb 0x180021170
cmp edx, ecx
jne 0x180021351
mov eax, ecx
mov qword [rsp + rax*8 + 0x58], rsi
mov ecx, dword [rsp + 0x50]
inc ecx
mov dword [rsp + 0x50], ecx
jmp 0x180021351
mov rsi, qword [rbx + 0x158]
cmp rsi, 0xffffffffffffffff
je 0x180021125
movzx eax, byte [rbx + 0x179]
test al, al
jne 0x180021121
lea rax, [rsp + 0x50]
test rax, rax
je 0x18002121d
mov ecx, dword [rsp + 0x50]
cmp ecx, 0x800
jb 0x1800211e9
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x18002121d
mov ecx, dword [rsp + 0x50]
mov edx, edi
test ecx, ecx
je 0x1800211ff
nop
mov eax, edx
cmp rsi, qword [rsp + rax*8 + 0x58]
je 0x1800211ff
inc edx
cmp edx, ecx
jb 0x1800211f0
cmp edx, ecx
jne 0x180021125
mov eax, ecx
mov qword [rsp + rax*8 + 0x58], rsi
mov ecx, dword [rsp + 0x50]
inc ecx
mov dword [rsp + 0x50], ecx
jmp 0x180021125
lea rdx, str.Could_not_add_listen_socket_to_fdset
mov rcx, rbx
call fcn.180029dd0
xor eax, eax
mov rsi, qword [rsp + 0xc0b8]
mov r14, qword [rsp + 0xc0c0]
mov rcx, qword [rbp + 0xbf80]
xor rcx, rsp
call fcn.18002b180
mov rbx, qword [rsp + 0xc0c8]
add rsp, 0xc090
pop r15
pop rdi
pop rbp
ret
mov rdx, qword [rbx + 0x158]
cmp rdx, 0xffffffffffffffff
je 0x180021351
movzx eax, byte [rbx + 0x179]
mov ecx, dword [rsp + 0x50]
test al, al
jne 0x180021351
mov r8d, edi
test ecx, ecx
je 0x1800212d5
nop dword [rax]
mov eax, r8d
cmp qword [rsp + rax*8 + 0x58], rdx
je 0x1800212a4
inc r8d
cmp r8d, ecx
jb 0x180021290
jmp 0x1800212d5
lea eax, [rcx - 1]
cmp r8d, eax
jae 0x1800212cf
nop dword [rax]
mov ecx, r8d
lea edx, [r8 + 1]
mov rax, qword [rsp + rdx*8 + 0x58]
mov r8d, edx
mov qword [rsp + rcx*8 + 0x58], rax
mov ecx, dword [rsp + 0x50]
lea eax, [rcx - 1]
cmp edx, eax
jb 0x1800212b0
dec ecx
mov dword [rsp + 0x50], ecx
mov rsi, qword [rbx + 0x168]
lea rax, [rsp + 0x50]
test rax, rax
je 0x180021338
cmp rsi, 0xffffffffffffffff
je 0x180021338
cmp ecx, 0x800
jb 0x18002130a
lea rdx, [rsp + 0x50]
mov rcx, rsi
call qword [sym.imp.WS2_32.dll___WSAFDIsSet]
test eax, eax
je 0x180021338
mov ecx, dword [rsp + 0x50]
mov edx, edi
test ecx, ecx
je 0x18002117f
nop dword [rax]
nop dword [rax + rax]
mov eax, edx
cmp rsi, qword [rsp + rax*8 + 0x58]
je 0x18002117f
inc edx
cmp edx, ecx
jb 0x180021320
jmp 0x18002117f
lea rdx, str.Could_not_add_control_inter_thread_communication_channel_FD_to_fdset
mov rcx, rbx
call fcn.180029dd0
mov ecx, dword [rsp + 0x50]
mov r14d, 1
mov rdx, qword [rbx + 0x158]
cmp rdx, 0xffffffffffffffff
je 0x1800213d5
cmp qword [rbx + 0x168], 0xffffffffffffffff
je 0x1800213d5
mov eax, dword [rbx + 0x184]
cmp dword [rbx + 0x180], eax
je 0x18002137f
cmp byte [rbx + 0x17a], dil
je 0x1800213d5
mov r8d, edi
test ecx, ecx
je 0x1800213d5
mov eax, r8d
cmp qword [rsp + rax*8 + 0x58], rdx
je 0x18002139a
inc r8d
cmp r8d, ecx
jb 0x180021386
jmp 0x1800213d5
lea eax, [rcx - 1]
cmp r8d, eax
jae 0x1800213cf
nop dword [rax]
nop word [rax + rax]
mov ecx, r8d
lea edx, [r8 + 1]
mov rax, qword [rsp + rdx*8 + 0x58]
mov r8d, edx
mov qword [rsp + rcx*8 + 0x58], rax
mov ecx, dword [rsp + 0x50]
lea eax, [rcx - 1]
cmp edx, eax
jb 0x1800213b0
dec ecx
mov dword [rsp + 0x50], ecx
mov rsi, rdi
cmp r14d, 1
je 0x180021454
test r15d, r15d
je 0x180021454
mov eax, dword [rbx + 0x194]
and eax, 4
test al, al
jne 0x18002145e
lea rdx, [rsp + 0x40]
mov rcx, rbx
call fcn.180020d60
cmp eax, 1
jne 0x18002144e
mov rcx, qword [rsp + 0x40]
movabs rax, 0x624dd2f1a9fbe77
mul rcx
mov r8, rcx
sub r8, rdx
shr r8, 1
add r8, rdx
shr r8, 9
imul eax, r8d, 0x3e8
sub ecx, eax
imul eax, ecx, 0x3e8
mov ecx, dword [rsp + 0x50]
mov dword [rsp + 0x34], eax
mov eax, 0x7fffffff
cmp r8, rax
cmova r8d, eax
mov dword [rsp + 0x30], r8d
jmp 0x180021459
mov ecx, dword [rsp + 0x50]
jmp 0x18002145e
mov qword [rsp + 0x30], rdi
lea rsi, [rsp + 0x30]
test ecx, ecx
jne 0x18002149f
cmp dword [rbp + 0x7f70], edi
jne 0x18002149f
cmp dword [rbp + 0x3f60], edi
jne 0x18002149f
test rsi, rsi
jne 0x18002147b
mov eax, edi
jmp 0x1800214bf
mov eax, 0x10624dd3
imul dword [rsi + 4]
imul eax, dword [rsi], 0x3e8
sar edx, 6
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add ecx, eax
call qword [sym.imp.KERNEL32.dll_Sleep]
mov eax, edi
jmp 0x1800214bf
lea r9, [rbp + 0x3f60]
mov qword [rsp + 0x20], rsi
lea r8, [rbp + 0x7f70]
xor ecx, ecx
lea rdx, [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_select]
movzx ecx, byte [rbx + 0x178]
test cl, cl
jne 0x18002122c
test eax, eax
jns 0x1800214fd
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2714
je 0x180021521
mov ecx, eax
call fcn.180029280
mov r8, rax
lea rdx, str.select_failed:__s_n
mov rcx, rbx
call fcn.180029dd0
jmp 0x18002122c
lea r9, [rbp + 0x3f60]
mov rcx, rbx
lea r8, [rbp + 0x7f70]
lea rdx, [rsp + 0x50]
call fcn.180020eb0
cmp eax, 1
jne 0x18002122c
test r14d, r14d
sete dil
mov eax, edi
jmp 0x18002122e