Function at 0x140043e80
Capabilities:
Set socket configuration

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rdi
sub rsp, 0x50
mov rax, qword [0x140116008]
xor rax, rsp
mov qword [rsp + 0x40], rax
mov edx, dword [0x1401595d0]
xor ebp, ebp
movzx ebx, byte [0x1401595d4]
cmp bl, 0xff
cmove edx, ebp
mov dword [0x1401595d0], edx
test edx, edx
je 0x14004400b
sub edx, 1
je 0x140043f36
sub edx, 1
je 0x140043ef3
cmp edx, 1
jne 0x140044101
cmp bl, 0xff
je 0x140043ee8
movzx ecx, bl
call fcn.1400486c0
mov byte [0x1401595d4], 0xff
mov dword [0x1401595d0], ebp
jmp 0x140044101
mov eax, dword [0x14015960c]
cmp eax, dword [0x1409639b0]
je 0x140043f10
mov dword [0x1401595d0], 3
jmp 0x140044101
call fcn.140009a00
sub eax, dword [0x140159614]
cmp eax, 0x1b5030
jbe 0x140043f27
call fcn.140042ea0
call fcn.1400433d0
call fcn.140043970
jmp 0x140044101
mov rcx, qword [0x14015e168]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
movzx eax, bl
lea rdi, [0x1401596c0]
imul rcx, rax, 0xc70
mov ebx, dword [rcx + rdi]
mov rcx, qword [0x14015e168]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp ebx, 1
jne 0x140044101
mov rcx, qword [0x14015e168]
mov eax, 2
movzx ebx, byte [0x1401595d4]
mov dword [0x1401595d0], eax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
imul rcx, rbx, 0xc70
cmp dword [rcx + rdi], ebp
je 0x140043ff4
cmp dword [0x14095e450], ebp
mov dword [rsp + 0x30], 0xfaffffef
je 0x140043fbc
cmp dword [0x14015e160], ebp
jle 0x140043fbc
mov eax, dword [0x140159664]
mov dword [rsp + 0x34], eax
jmp 0x140043fc0
mov dword [rsp + 0x34], ebp
mov rcx, qword [rcx + rdi + 8]
lea r9, [rsp + 0x30]
xor edx, edx
mov dword [rsp + 0x20], 8
lea r8d, [rdx + 0xc]
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x140043ff4
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, 0x680
call fcn.140047310
mov rcx, qword [0x14015e168]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.140042ea0
jmp 0x140044101
mov rcx, qword [0x14015e168]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
call fcn.140048470
movzx ebx, al
cmp ebx, 6
je 0x1400440c5
xor eax, eax
mov qword [rsp + 0x60], rsi
imul rsi, rbx, 0xc70
cmp dword [0x14095e450], ebp
lea rdi, [0x1401596c0]
mov qword [rsp + 0x30], rax
mov ecx, 0x76c
mov qword [rsp + 0x38], rax
mov eax, 2
mov word [rsp + 0x30], ax
mov word [rsi + rdi + 0x3c], cx
je 0x140044078
cmp dword [0x14015e160], ebp
jle 0x140044078
mov eax, dword [0x140159664]
mov dword [rsp + 0x34], eax
jmp 0x14004407c
mov dword [rsp + 0x34], ebp
call qword [sym.imp.WS2_32.dll_htons]
mov rcx, qword [rsi + rdi + 8]
lea rdx, [rsp + 0x30]
mov r8d, reloc.WS2_32.dll_recv
mov word [rsp + 0x32], ax
call qword [sym.imp.WS2_32.dll_bind]
mov rsi, qword [rsp + 0x60]
test eax, eax
jns 0x1400440c5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, 0x574
call fcn.140047310
movzx ecx, bl
call fcn.1400486c0
mov ebx, 0xff
mov rcx, qword [0x14015e168]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [0x1401595d4], bl
cmp bl, 0xff
jne 0x1400440eb
lea rcx, str.SSDP:_Cant_open_SSPD_UDP_Socket_n
call fcn.140041200
jmp 0x140044101
mov eax, dword [0x1409639b0]
mov dword [0x14015960c], eax
mov dword [0x1401595d0], 1
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.14004ee60
mov rbx, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
add rsp, 0x50
pop rdi
ret