Function at 0x140021370
Capabilities:
Create thread
Set socket configuration

Disassembly:
push rdi
push r14
sub rsp, 0x88
mov rax, qword [0x140116008]
xor rax, rsp
mov qword [rsp + 0x50], rax
cmp dword [rcx], 0
mov rdi, r8
mov r14, rcx
je 0x14002139c
xor eax, eax
jmp 0x140021706
mov qword [rsp + 0xa8], rbx
xor edx, edx
mov qword [rsp + 0x80], rbp
mov r8d, 0x2b0
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0x70], r12
mov qword [rsp + 0x68], r13
mov qword [rsp + 0x60], r15
call fcn.1400500b0
lea rax, [0x140005df0]
xor ecx, ecx
lea rdx, [0x140158b30]
mov qword [r14 + 8], rax
call fcn.140020440
xor r13d, r13d
mov dword [0x140158b90], eax
lea r12, str.ytcp
mov ebp, r13d
test eax, eax
jle 0x14002159e
lea rsi, [0x140158b34]
mov r15d, 2
lea rbx, [r14 + 0x50]
mov r8d, reloc.WS2_32.dll_recvfrom
mov edx, r15d
mov ecx, r15d
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rbx - 0x40], rax
cmp rax, 0xffffffffffffffff
je 0x14002169b
lea r9, [rsp + 0x30]
mov dword [rsp + 0x30], 1
mov edx, 0xffff
mov dword [rsp + 0x20], 4
mov r8d, 4
mov rcx, rax
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rcx, qword [rbx - 0x40]
lea rdx, [rsp + 0x40]
xor eax, eax
mov r8d, reloc.WS2_32.dll_recv
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rax
mov eax, dword [rsi]
mov dword [rsp + 0x44], eax
mov word [rsp + 0x40], r15w
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x14002167b
mov r8d, reloc.WS2_32.dll_recvfrom
mov edx, r15d
mov ecx, r15d
call qword [sym.imp.WS2_32.dll_socket]
mov qword [rbx], rax
cmp rax, 0xffffffffffffffff
je 0x14002165b
lea r9, [rsp + 0x30]
mov dword [rsp + 0x30], 1
mov edx, 0xffff
mov dword [rsp + 0x20], 4
mov r8d, 4
mov rcx, rax
call qword [sym.imp.WS2_32.dll_setsockopt]
xor eax, eax
mov ecx, 0x76c
mov qword [rsp + 0x40], rax
mov word [rsp + 0x40], r15w
mov qword [rsp + 0x48], rax
call qword [sym.imp.WS2_32.dll_htons]
mov rcx, qword [rbx]
lea rdx, [rsp + 0x40]
mov r8d, reloc.WS2_32.dll_recv
mov word [rsp + 0x42], ax
mov dword [rsp + 0x44], r13d
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x140021638
lea rcx, str.239.255.255.250
call qword [sym.imp.WS2_32.dll_inet_addr]
mov rcx, qword [rbx]
lea r9, [rsp + 0x38]
xor edx, edx
mov dword [rsp + 0x38], eax
mov eax, dword [rsi]
mov dword [rsp + 0x3c], eax
mov dword [rsp + 0x20], 8
lea r8d, [rdx + 0xc]
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140021588
lea r8, str.Unable_to_add_multicast_membership_for_SSDP
mov edx, 0xf20
mov rcx, r12
call fcn.14000a9a0
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, 0xf21
call fcn.14001a0c0
mov rcx, qword [rbx]
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [rbx], 0xffffffffffffffff
inc ebp
add rbx, 8
add rsi, 0xc
cmp ebp, dword [0x140158b90]
jl 0x140021412
lea rbx, [r14 + 0x90]
mov eax, dword [rbx + 0x10]
cmp eax, 1
je 0x1400216d0
test eax, eax
jne 0x140021601
xor r9d, r9d
mov qword [rbx], r14
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r9, rbx
mov qword [rsp + 0x28], r13
lea r8, [0x140020e80]
mov qword [rbx + 8], rax
xor edx, edx
mov dword [rsp + 0x20], r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov qword [rbx + 0x18], rax
mov rcx, qword [rbx + 8]
test rax, rax
jne 0x1400216bb
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rdi, rdi
je 0x14002162e
mov dword [rsp + 0x28], 0xf28
lea r9, str.Unable_to_start_helper_thread
lea r8, str._s___s:_d_
mov qword [rsp + 0x20], r12
mov edx, 0x100
mov rcx, rdi
call fcn.1400217a0
mov eax, 0xfffffff8
jmp 0x1400216e2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14002162e
mov r9, rdi
mov r8d, eax
mov edx, 0xf1a
mov rcx, r12
call fcn.140019fe0
jmp 0x1400216e2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14002162e
mov r9, rdi
mov r8d, eax
mov edx, 0xf0a
mov rcx, r12
call fcn.140019fe0
jmp 0x1400216e2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14002162e
mov r9, rdi
mov r8d, eax
mov edx, 0xf05
mov rcx, r12
call fcn.140019fe0
jmp 0x1400216e2
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
test rdi, rdi
je 0x14002162e
mov r9, rdi
mov r8d, eax
mov edx, 0xef6
mov rcx, r12
call fcn.140019fe0
jmp 0x1400216e2
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rbx + 8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, rdi
mov dword [r14], 1
mov rcx, r14
call fcn.1400211e0
mov r13, qword [rsp + 0x68]
mov r12, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
mov rbp, qword [rsp + 0x80]
mov rbx, qword [rsp + 0xa8]
mov r15, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.14004ee60
add rsp, 0x88
pop r14
pop rdi
ret