Function at 0x140178810
Capabilities:
Set socket configuration

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
sub rsp, 0x60
xor sil, sil
mov rdi, r8
cmp qword [rcx + 0xf8], 0
mov rbp, rdx
mov rbx, rcx
jne 0x14017884f
cmp qword [rcx + 0x100], 0
jne 0x14017884f
mov rdx, rcx
mov r8d, 7
lea rcx, [rsp + 0x50]
call fcn.1401790e0
or dword [rdi], 2
cmp qword [rbx + 0x1a0], 0
jne 0x140178a37
mov rax, qword [rbx + 0xd18]
test rax, rax
jne 0x140178888
mov ecx, dword [rbx + 0x720]
call qword [fcn.14019fb0c]
mov qword [rbx + 0xd18], rax
test rax, rax
je 0x140178998
mov qword [rbx + 0x1a8], rax
cmp byte [rbx + 0x1c2], sil
jne 0x140178b2d
cmp dword [rbx + 0x170], 2
mov rcx, qword [rbx + 0x1b0]
jne 0x1401788f4
cmp dword [rcx + 0x200], 2
jne 0x1401788f4
and dword [rbx + 0x15c], 0xfffffffd
lea rcx, [rsp + 0x50]
mov dword [rbx + 0x170], 1
call fcn.140170040
xor r8d, r8d
mov rcx, rbx
movups xmm0, xmmword [rax]
movups xmmword [rbx + 0x160], xmm0
and dword [rdi], 0xfffffffd
movsxd rdx, dword [rbx + 0xa98]
call fcn.140159120
jmp 0x140178c68
mov rax, qword [rbp + 0x428]
test dword [rax + 0x84], 0x40003
je 0x140178912
cmp dword [rcx + 0x200], 1
sete sil
mov edx, dword [rbx + 0x720]
lea r8, [rsp + 0x80]
mov rcx, rbx
call fcn.140176e00
test eax, eax
jne 0x140178c6a
mov rdi, qword [rsp + 0x80]
test rdi, rdi
je 0x140178b2d
jle 0x140178b3a
mov qword [rbx + 0x1a0], rdi
test sil, sil
jne 0x140178a37
cmp byte [rbx + 0xafe], sil
je 0x140178a37
cmp qword [rbx + 0xdd0], 0
jne 0x1401789ad
mov eax, dword [rbx + 0x720]
lea ecx, [rax + rax]
call qword [fcn.14019fb0c]
mov qword [rbx + 0xdd0], rax
test rax, rax
jne 0x1401789ad
lea rdx, str.Failed_to_alloc_scratch_buffer
mov rcx, rbx
call fcn.140169a60
mov eax, 0x1b
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret
xor ecx, ecx
xor edx, edx
test rdi, rdi
jle 0x140178a1d
nop word [rax + rax]
mov rax, qword [rbx + 0x1a8]
mov r8, qword [rbx + 0xdd0]
movzx r9d, byte [rdx + rax]
cmp r9b, 0xa
jne 0x140178a0e
mov byte [r8 + rcx], reloc.WS2_32.dll_listen
inc rcx
mov rax, qword [rbx + 0xdd0]
mov byte [rcx + rax], r9b
cmp byte [rbx + 0xafe], 0
jne 0x140178a12
mov rax, qword [rbx + 0x11c0]
cmp rax, 0xffffffffffffffff
je 0x140178a12
inc rax
mov qword [rbx + 0x11c0], rax
jmp 0x140178a12
mov byte [r8 + rcx], r9b
inc rdx
inc rcx
cmp rdx, rdi
jl 0x1401789c0
cmp rcx, rdi
je 0x140178a37
mov rax, qword [rbx + 0xdd0]
mov qword [rbx + 0x1a8], rax
mov qword [rbx + 0x1a0], rcx
mov r9, qword [rbx + 0x1a0]
lea rax, [rsp + 0x98]
mov r8, qword [rbx + 0x1a8]
mov rcx, rbx
mov rdx, qword [rbp + 0x450]
mov qword [rsp + 0x20], rax
call fcn.140169fe0
test eax, eax
jne 0x140178c6a
mov rdi, qword [rbp + 0x450]
lea rax, [rsp + 0x90]
mov qword [rsp + 0x40], 0
xor r9d, r9d
mov qword [rsp + 0x38], 0
xor r8d, r8d
mov qword [rsp + 0x30], rax
mov edx, 0x4004747b
lea rax, [rsp + 0x80]
mov dword [rsp + 0x28], 4
mov rcx, rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x140178ae0
lea r9, [rsp + 0x80]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rdi
call qword [sym.imp.WS2_32.dll_setsockopt]
mov rax, qword [rbx + 0x118]
test rax, rax
je 0x140178b72
mov rdi, qword [rsp + 0x98]
mov edx, 2
mov r8, qword [rbx + 0x1a8]
cmp rax, rdi
mov rcx, rbx
cmovl rdi, rax
mov r9, rdi
call fcn.140169990
mov rcx, qword [rsp + 0x98]
sub qword [rbx + 0x118], rdi
mov rsi, rcx
sub rsi, rdi
jmp 0x140178b7d
test byte [rbx + 0x15c], 0x20
jne 0x140178c68
mov rax, qword [rbx + 0x18]
and dword [rbx + 0x15c], 0xfffffffd
cmp byte [rax + 0x3f5], 0
je 0x140178c68
mov rcx, rbx
call fcn.1401779e0
test eax, eax
je 0x140178c68
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret
mov rcx, qword [rsp + 0x98]
mov rsi, rcx
test rsi, rsi
je 0x140178bbd
mov r8, qword [rbx + 0x1a8]
mov r9, rsi
sub r8, rsi
mov edx, 4
add r8, rcx
mov rcx, rbx
call fcn.140169990
add qword [rbx + 0x100], rsi
mov rcx, rbx
mov rdx, qword [rbx + 0x100]
call fcn.140178f90
mov rcx, qword [rsp + 0x98]
cmp byte [rbx + 0x1c7], 0
je 0x140178bcf
cmp byte [rbx + 0x1c9], 0
je 0x140178be6
mov rax, qword [rbx + 0x11c0]
cmp qword [rbx + 0x100], rax
jne 0x140178be6
mov byte [rbx + 0x1c2], 1
mov rax, qword [rbx + 0x1a0]
cmp rax, rcx
je 0x140178c05
sub rax, rcx
add qword [rbx + 0x1a8], rcx
mov qword [rbx + 0x1a0], rax
jmp 0x140178c68
mov rax, qword [rbx + 0xd18]
test rax, rax
jne 0x140178c2d
mov ecx, dword [rbx + 0x720]
call qword [fcn.14019fb0c]
mov qword [rbx + 0xd18], rax
test rax, rax
je 0x140178998
cmp byte [rbx + 0x1c2], 0
mov qword [rbx + 0x1a8], rax
mov qword [rbx + 0x1a0], 0
je 0x140178c68
mov rax, qword [rbx + 0x18]
and dword [rbx + 0x15c], 0xfffffffd
cmp byte [rax + 0x3f5], 0
je 0x140178c68
mov rcx, rbx
call fcn.1401779e0
test eax, eax
jne 0x140178c6a
xor eax, eax
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret