Function at 0x140218160
Capabilities:
Set socket configuration

Disassembly:
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
sub rsp, 0x60
xor bpl, bpl
mov rsi, r8
cmp qword [rcx + 0xf8], 0
mov rdi, rdx
mov rbx, rcx
jne 0x140218196
cmp qword [rcx + 0x100], 0
jne 0x140218196
mov edx, 7
call fcn.14021ffe0
or dword [rsi], 2
cmp qword [rbx + 0x1d0], 0
jne 0x14021839c
mov rax, qword [rbx + 0x1130]
test rax, rax
jne 0x1402181d0
mov rcx, qword [rbx + 0xb78]
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 0x1130], rax
test rax, rax
je 0x1402182df
mov qword [rbx + 0x1d8], rax
cmp byte [rbx + 0x65a], bpl
jne 0x1402184ea
cmp dword [rbx + 0x190], 2
mov rcx, qword [rbx + 0x1e0]
jne 0x14021823c
cmp dword [rcx + 0x210], 2
jne 0x14021823c
and dword [rbx + 0x1b8], 0xfffffffd
lea rcx, [rsp + 0x50]
mov dword [rbx + 0x190], 1
call fcn.1402185a0
xor r8d, r8d
mov rcx, rbx
movups xmm0, xmmword [rax]
movups xmmword [rbx + 0x180], xmm0
and dword [rsi], 0xfffffffd
movsxd rdx, dword [rbx + 0xea0]
call fcn.1401fdbd0
jmp 0x140218583
mov rax, qword [rdi + 0x698]
test dword [rax + 0x7c], 0x40003
je 0x140218257
cmp dword [rcx + 0x210], 1
sete bpl
mov rdx, qword [rbx + 0xb78]
lea r8, [rsp + 0x80]
mov rcx, rdi
call fcn.1402171a0
test eax, eax
jne 0x140218585
mov rsi, qword [rsp + 0x80]
test rsi, rsi
je 0x1402184ea
jle 0x1402184f7
mov qword [rbx + 0x1d0], rsi
test bpl, bpl
jne 0x140218379
cmp byte [rbx + 0xf06], bpl
je 0x140218379
cmp qword [rbx + 0x11a8], 0
jne 0x1402182f4
mov rcx, qword [rbx + 0xb78]
add rcx, rcx
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 0x11a8], rax
test rax, rax
jne 0x1402182f4
lea rdx, str.Failed_to_alloc_scratch_buffer_
mov rcx, rbx
call fcn.14020e0a0
mov eax, reloc.WLDAP32.dll_Ordinal_27
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret
xor ecx, ecx
xor edx, edx
test rsi, rsi
jle 0x14021835c
nop dword [rax]
mov rax, qword [rbx + 0x1d8]
movzx r8d, byte [rdx + rax]
mov rax, qword [rbx + 0x11a8]
cmp r8b, 0xa
jne 0x14021834d
mov byte [rax + rcx], reloc.WS2_32.dll_listen
inc rcx
mov rax, qword [rbx + 0x11a8]
mov byte [rcx + rax], r8b
cmp byte [rbx + 0xf06], 0
jne 0x140218351
mov rax, qword [rbx + 0x1508]
cmp rax, 0xffffffffffffffff
je 0x140218351
inc rax
mov qword [rbx + 0x1508], rax
jmp 0x140218351
mov byte [rax + rcx], r8b
inc rdx
inc rcx
cmp rdx, rsi
jl 0x140218300
cmp rcx, rsi
je 0x140218379
mov rax, qword [rbx + 0x11a8]
mov rsi, rcx
mov qword [rbx + 0x1d8], rax
mov qword [rbx + 0x1d0], rcx
mov rax, qword [rdi + 0x698]
test dword [rax + 0x7c], 0x30000
je 0x14021839c
mov rdx, rsi
mov rcx, rdi
call fcn.14022c420
test eax, eax
jne 0x140218585
mov r9, qword [rbx + 0x1d0]
lea rax, [rsp + 0x98]
mov r8, qword [rbx + 0x1d8]
mov rcx, rdi
mov rdx, qword [rdi + 0x6d0]
mov qword [rsp + 0x20], rax
call fcn.14020e650
test eax, eax
jne 0x140218585
mov rsi, qword [rdi + 0x6d0]
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, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
jne 0x140218445
lea r9, [rsp + 0x80]
mov dword [rsp + 0x20], 4
mov edx, 0xffff
mov r8d, 0x1001
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
cmp byte [rbx + 0xf1e], 0
je 0x14021846a
mov r9, qword [rsp + 0x98]
mov edx, 4
mov r8, qword [rbx + 0x1d8]
mov rcx, rbx
call fcn.14020e700
mov rax, qword [rsp + 0x98]
mov rcx, rbx
add qword [rbx + 0x100], rax
mov rdx, qword [rbx + 0x100]
call fcn.14021fdb0
cmp byte [rbx + 0x65e], 0
je 0x14021849a
cmp byte [rbx + 0x660], 0
je 0x1402184c0
mov rax, qword [rbx + 0x1508]
cmp qword [rbx + 0x100], rax
jne 0x1402184c0
lea rdx, str.We_are_completely_uploaded_and_fine_n
mov byte [rbx + 0x65a], 1
mov rcx, rbx
call fcn.14020df30
mov rax, qword [rbx + 0x1d0]
mov rcx, qword [rsp + 0x98]
cmp rax, rcx
je 0x140218523
sub rax, rcx
add qword [rbx + 0x1d8], rcx
mov qword [rbx + 0x1d0], rax
jmp 0x140218583
test byte [rbx + 0x1b8], 0x20
jne 0x140218583
and dword [rbx + 0x1b8], 0xfffffffd
cmp byte [rdi + 0x665], 0
je 0x140218583
mov rcx, rdi
call fcn.140216ff0
test eax, eax
je 0x140218583
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret
mov rax, qword [rbx + 0x1130]
test rax, rax
jne 0x14021854c
mov rcx, qword [rbx + 0xb78]
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [rbx + 0x1130], rax
test rax, rax
je 0x1402182df
cmp byte [rbx + 0x65a], 0
mov qword [rbx + 0x1d8], rax
mov qword [rbx + 0x1d0], 0
je 0x140218583
and dword [rbx + 0x1b8], 0xfffffffd
cmp byte [rdi + 0x665], 0
je 0x140218583
mov rcx, rdi
call fcn.140216ff0
test eax, eax
jne 0x140218585
xor eax, eax
mov rbx, qword [rsp + 0x88]
add rsp, 0x60
pop rdi
pop rsi
pop rbp
ret