Function at 0x1400c2d40
Capabilities:
Convert ip address from string
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x288
mov rsi, rdx
mov rdi, rcx
mov rax, qword [0x14013aa80]
xor rax, rsp
mov qword [rsp + 0x280], rax
mov r12, qword [rcx + 0x10]
lea rbx, [rsp + 0x100]
mov rcx, rbx
call fcn.1400902e0
movups xmm0, xmmword [rsp + 0x100]
movups xmmword [r12 + 0x148], xmm0
lea r14, [r12 + 8]
cmp qword [rsi + 0x288], 0
je 0x1400c2dd7
mov rcx, rsi
mov dl, 1
call fcn.140085ac0
mov rcx, qword [rsi + 0x290]
xor edx, edx
mov r8, r14
call qword [rsi + 0x288]
mov qword [r12 + 0x98], rax
mov rcx, rsi
xor edx, edx
call fcn.140085ac0
mov rax, qword [r12 + 0x98]
jmp 0x1400c2df4
mov r8d, dword [r12 + 0x10]
mov ecx, dword [r12 + 8]
mov edx, dword [r12 + 0xc]
call qword [sym.imp.WS2_32.dll_socket]
mov qword [r12 + 0x98], rax
mov ebp, 7
cmp rax, 0xffffffffffffffff
je 0x1400c2ed4
mov rax, qword [rsi + 0x20]
mov eax, dword [rax + 0x608]
test eax, eax
je 0x1400c2e1c
cmp dword [r14], 0x17
jne 0x1400c2e1c
mov dword [r12 + 0x30], eax
mov r15, qword [rdi + 0x10]
lea r9, [r15 + 0x110]
lea r8, [r15 + 0xe0]
mov edx, dword [r15 + 0x14]
lea rcx, [r15 + 0x18]
call fcn.14008e730
test al, al
je 0x1400c2e89
cmp dword [r14], 0x17
jne 0x1400c2f5a
mov rcx, qword [r12 + 0x98]
mov dword [rsp + 0x100], 0
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x100]
mov edx, 0x29
mov r8d, 0x1b
call qword [sym.imp.WS2_32.dll_setsockopt]
lea rdx, str.__Trying___s_:_d...
jmp 0x1400c2f61
mov r14, qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
call r14
mov eax, dword [rax]
mov dword [r15 + 0x178], eax
call r14
mov ecx, dword [rax]
lea rdx, [rsp + 0x100]
mov r8d, 0x100
call fcn.1400ba2b0
mov rbx, rax
call r14
mov r8d, dword [rax]
lea rdx, str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov rcx, rsi
mov r9, rbx
call fcn.140079120
mov ebp, 2
mov rbx, qword [r12 + 0x98]
cmp rbx, 0xffffffffffffffff
je 0x1400c2f34
mov rdi, qword [rdi + 0x18]
test rdi, rdi
je 0x1400c2f1f
mov r14, qword [rdi + 0x38]
mov rcx, rsi
mov rdx, rbx
call fcn.1400854e0
test r14, r14
je 0x1400c2f1f
mov rcx, rsi
mov dl, 1
call fcn.140085ac0
mov rcx, qword [rdi + 0x40]
mov rdx, rbx
call qword [rdi + 0x38]
mov rcx, rsi
xor edx, edx
call fcn.140085ac0
jmp 0x1400c2f28
mov rcx, rbx
call qword [sym.imp.WS2_32.dll_closesocket]
mov qword [r12 + 0x98], 0xffffffffffffffff
mov rcx, qword [rsp + 0x280]
xor rcx, rsp
call fcn.1400d2000
mov eax, ebp
add rsp, 0x288
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
lea rdx, str.__Trying__s:_d...
mov r9d, dword [r12 + 0x110]
lea r8, [r12 + 0xe0]
mov rcx, rsi
call fcn.1400791f0
mov eax, dword [r12 + 8]
cmp eax, 0x17
je 0x1400c2f8c
cmp eax, 2
jne 0x1400c3113
cmp dword [r12 + 0xc], 1
jne 0x1400c3113
cmp byte [rsi + 0xa3d], 0
je 0x1400c3006
mov rcx, qword [r12 + 0x98]
mov dword [rsp + 0x200], 1
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x200]
mov edx, 6
mov r8d, 1
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x1400c3006
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, [rsp + 0x100]
mov r8d, 0x100
mov ecx, eax
call fcn.1400ba2b0
lea rdx, str.Could_not_set_TCP_NODELAY:__s
mov rcx, rsi
mov r8, rax
call fcn.1400791f0
mov rcx, qword [r12 + 0x98]
call fcn.1400c19e0
movzx eax, byte [rsi + 0xa44]
test eax, eax
je 0x1400c3120
mov r15, qword [r12 + 0x98]
mov dword [rsp + 0x200], eax
mov dword [rsp + 0x20], 4
lea r9, [rsp + 0x200]
mov rcx, r15
mov edx, 0xffff
mov r8d, 8
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x1400c334e
mov dword [rsp + 0x100], 1
mov ecx, dword [rsi + 0x9c4]
call fcn.140088560
imul eax, eax, 0x3e8
mov dword [rsp + 0x200], eax
mov dword [rsp + 0x104], eax
mov ecx, dword [rsi + 0x9c8]
call fcn.140088560
imul eax, eax, 0x3e8
mov dword [rsp + 0x200], eax
mov dword [rsp + 0x108], eax
xorps xmm0, xmm0
movups xmmword [rsp + 0x38], xmm0
lea rax, [rsp + 0x80]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
lea r8, [rsp + 0x100]
mov rcx, r15
mov edx, 0x98000004
mov r9d, reloc.WS2_32.dll_inet_ntoa
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x1400c3120
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d
mov rcx, rsi
mov r8d, r15d
mov r9d, eax
call fcn.1400791f0
cmp qword [rsi + 0x278], 0
jne 0x1400c312a
jmp 0x1400c3170
mov rcx, qword [r12 + 0x98]
call fcn.1400c19e0
cmp qword [rsi + 0x278], 0
je 0x1400c3170
mov rcx, rsi
mov dl, 1
call fcn.140085ac0
mov rdx, qword [r12 + 0x98]
mov rcx, qword [rsi + 0x280]
xor r13d, r13d
xor r8d, r8d
call qword [rsi + 0x278]
mov r15d, eax
mov rcx, rsi
xor edx, edx
call fcn.140085ac0
cmp r15d, 2
je 0x1400c3173
mov ebp, 0x2a
test r15d, r15d
jne 0x1400c2ed4
mov r13b, 1
mov eax, dword [r14]
cmp eax, 0x17
je 0x1400c3184
cmp eax, 2
jne 0x1400c343f
mov dword [rsp + 0x58], r13d
lea rcx, [r12 + 0x18]
call fcn.1400d0f00
mov r13d, eax
mov edx, dword [r12 + 8]
mov rax, qword [r12 + 0x98]
mov qword [rsp + 0x68], rax
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x78], 0
movzx ebp, word [rsi + 0x230]
movzx r15d, word [rsi + 0x232]
mov r14, qword [rsi + 0x730]
test r14, r14
jne 0x1400c31df
test bp, bp
jne 0x1400c31df
mov r13d, dword [rsp + 0x58]
jmp 0x1400c343f
mov qword [rsp + 0x60], rax
xorps xmm0, xmm0
movaps xmmword [rsp + 0x270], xmm0
movaps xmmword [rsp + 0x260], xmm0
movaps xmmword [rsp + 0x250], xmm0
movaps xmmword [rsp + 0x240], xmm0
movaps xmmword [rsp + 0x230], xmm0
movaps xmmword [rsp + 0x220], xmm0
movaps xmmword [rsp + 0x210], xmm0
movaps xmmword [rsp + 0x200], xmm0
test r14, r14
je 0x1400c331c
mov rcx, r14
mov dword [rsp + 0x54], edx
call sub.api_ms_win_crt_string_l1_1_0.dll_strlen
mov edx, dword [rsp + 0x54]
cmp rax, 0xfe
ja 0x1400c331c
xorps xmm0, xmm0
movaps xmmword [rsp + 0x1f0], xmm0
movaps xmmword [rsp + 0x1e0], xmm0
movaps xmmword [rsp + 0x1d0], xmm0
movaps xmmword [rsp + 0x1c0], xmm0
movaps xmmword [rsp + 0x1b0], xmm0
movaps xmmword [rsp + 0x1a0], xmm0
movaps xmmword [rsp + 0x190], xmm0
movaps xmmword [rsp + 0x180], xmm0
movaps xmmword [rsp + 0x170], xmm0
movaps xmmword [rsp + 0x160], xmm0
movaps xmmword [rsp + 0x150], xmm0
movaps xmmword [rsp + 0x140], xmm0
movaps xmmword [rsp + 0x130], xmm0
movaps xmmword [rsp + 0x120], xmm0
movaps xmmword [rsp + 0x110], xmm0
movaps xmmword [rsp + 0x100], xmm0
lea rcx, [0x1401224ea]
mov r8d, 3
mov rdx, r14
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
mov dword [rsp + 0x5c], eax
test eax, eax
je 0x1400c356c
lea rcx, str.host_
mov r8d, 5
mov rdx, r14
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
test eax, eax
jne 0x1400c3570
add r14, 5
mov edx, dword [rsp + 0x54]
jmp 0x1400c35fa
cmp edx, 2
je 0x1400c3373
xor ebx, ebx
cmp edx, 0x17
mov r13d, dword [rsp + 0x58]
jne 0x1400c3397
mov word [rsp + 0x200], reloc.WS2_32.dll_socket
mov ecx, ebp
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x202], ax
mov ebx, 0x1c
jmp 0x1400c3397
lea rdx, str.Failed_to_set_SO_KEEPALIVE_on_fd__d
mov rcx, rsi
mov r8, r15
call fcn.1400791f0
cmp qword [rsi + 0x278], 0
jne 0x1400c312a
jmp 0x1400c3170
mov word [rsp + 0x200], 2
mov ecx, ebp
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x202], ax
mov ebx, reloc.WS2_32.dll_recv
mov r13d, dword [rsp + 0x58]
lea rdx, [rsp + 0x200]
mov rcx, qword [rsp + 0x68]
mov r8d, ebx
call qword [sym.imp.WS2_32.dll_bind]
test eax, eax
js 0x1400c348e
mov dword [rsp + 0x74], 0x80
xorps xmm0, xmm0
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x90], xmm0
movaps xmmword [rsp + 0xa0], xmm0
movaps xmmword [rsp + 0xb0], xmm0
movaps xmmword [rsp + 0xc0], xmm0
movaps xmmword [rsp + 0xd0], xmm0
movaps xmmword [rsp + 0xe0], xmm0
movaps xmmword [rsp + 0xf0], xmm0
lea rdx, [rsp + 0x80]
lea r8, [rsp + 0x74]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
js 0x1400c34fe
movzx r8d, bp
lea rdx, str.Local_port:__hu
mov rcx, rsi
call fcn.1400791f0
mov rax, qword [rsp + 0x60]
mov byte [rax + 0x2da], 1
mov rcx, qword [r12 + 0x98]
mov edx, 1
call fcn.1400cc680
xor ebp, ebp
test r13b, r13b
jne 0x1400c2f34
mov rcx, rdi
mov rdx, rsi
call fcn.1400c2c00
lea rcx, [rsp + 0x100]
call fcn.1400902e0
movups xmm0, xmmword [rsp + 0x100]
movups xmmword [r12 + 0x158], xmm0
mov byte [rdi + 0x24], 1
jmp 0x1400c2f34
movzx ebp, bp
mov r14, qword [sym.imp.WS2_32.dll_bind]
nop dword [rax + rax]
cmp r15d, 2
jl 0x1400c352a
cmp bp, 0xffff
je 0x1400c352a
inc ebp
movzx r13d, bp
lea r8d, [r13 - 1]
mov rcx, rsi
lea rdx, str.Bind_to_local_port__hu_failed__trying_next
call fcn.1400791f0
mov ecx, r13d
call qword [sym.imp.WS2_32.dll_ntohs]
mov word [rsp + 0x202], ax
mov rcx, qword [rsp + 0x68]
lea rdx, [rsp + 0x200]
mov r8d, ebx
call r14
dec r15d
test eax, eax
js 0x1400c34a0
mov r13d, dword [rsp + 0x58]
jmp 0x1400c33b5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
mov dword [rsi + 0xcfc], eax
lea rdx, [rsp + 0x100]
mov r8d, 0x100
mov ecx, eax
call fcn.1400ba2b0
lea rdx, str.getsockname___failed_with_errno__d:__s
jmp 0x1400c3554
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebx, eax
mov dword [rsi + 0xcfc], eax
lea rdx, [rsp + 0x100]
mov r8d, 0x100
mov ecx, eax
call fcn.1400ba2b0
lea rdx, str.bind_failed_with_errno__d:__s
mov rcx, rsi
mov r8d, ebx
mov r9, rax
call fcn.140079120
mov ebp, 0x2d
jmp 0x1400c2ed4
add r14, 3
mov rax, qword [rsp + 0x60]
mov r8d, dword [rax + 0x608]
mov qword [rsp + 0x20], rbx
mov dword [rsp + 0x28], 0x100
mov ecx, dword [rsp + 0x54]
mov edx, r13d
mov r9, r14
call fcn.140004b60
cmp eax, 2
je 0x1400c35c1
cmp eax, 1
mov edx, dword [rsp + 0x54]
je 0x1400c36f8
test eax, eax
jne 0x1400c35ef
cmp dword [rsp + 0x5c], 0
jne 0x1400c35fa
lea rdx, str.Couldnt_bind_to_interface__s
jmp 0x1400c3710
mov ebx, dword [rsp + 0x54]
mov dword [rsp + 0x20], ebx
lea rdx, str.Local_Interface__s_is_ip__s_using_address_family__i
lea r9, [rsp + 0x100]
mov rcx, rsi
mov r8, r14
call fcn.1400791f0
mov ecx, ebx
mov r13d, dword [rsp + 0x58]
jmp 0x1400c36c6
cmp dword [rsp + 0x5c], 0
je 0x1400c3702
mov rcx, qword [rsp + 0x60]
movzx r13d, byte [rcx + 0x614]
cmp edx, 2
je 0x1400c3615
cmp edx, 0x17
jne 0x1400c361d
mov al, 2
jmp 0x1400c3617
mov al, 1
mov byte [rcx + 0x614], al
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
mov rcx, rsi
mov rdx, r14
mov r8d, 0x50
xor r9d, r9d
call fcn.1400af030
cmp eax, 1
jne 0x1400c364d
lea rdx, [rsp + 0x78]
mov rcx, rsi
call fcn.14007c070
mov rax, qword [rsp + 0x60]
mov byte [rax + 0x614], r13b
mov rax, qword [rsp + 0x78]
test rax, rax
je 0x1400c3702
mov rcx, qword [rax]
mov r8d, 0x100
mov rdx, rbx
call fcn.1400ae800
mov rax, qword [rsp + 0x78]
mov rax, qword [rax]
mov eax, dword [rax + 4]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rbx
lea rdx, str.Name__s_family__i_resolved_to__s_family__i
mov rcx, rsi
mov r8, r14
mov ebx, dword [rsp + 0x54]
mov r9d, ebx
call fcn.1400791f0
mov rdx, qword [rsp + 0x78]
mov rcx, rsi
call fcn.1400af5e0
mov ecx, ebx
mov rax, qword [rsp + 0x78]
mov rax, qword [rax]
cmp dword [rax + 4], ebx
mov r13d, dword [rsp + 0x58]
jne 0x1400c36f8
xor ebx, ebx
cmp ecx, 2
je 0x1400c3725
cmp ecx, 0x17
jne 0x1400c3397
lea rcx, [rsp + 0x100]
mov edx, 0x25
call sub.VCRUNTIME140.dll_strchr
test rax, rax
je 0x1400c376c
mov r14, rax
inc r14
mov byte [rax], 0
jmp 0x1400c376f
mov ebp, 7
jmp 0x1400c2ed4
mov byte [rsi + 0x12af], 0
lea rdx, str.Couldnt_bind_to__s
mov rcx, rsi
mov r8, r14
call fcn.140079120
mov ebp, 0x2d
jmp 0x1400c2ed4
lea r8, [rsp + 0x204]
lea rdx, [rsp + 0x100]
mov ecx, 2
call qword [sym.imp.WS2_32.dll_inet_pton]
test eax, eax
jle 0x1400c3397
mov word [rsp + 0x200], 2
mov ecx, ebp
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x202], ax
mov ebx, reloc.WS2_32.dll_recv
jmp 0x1400c3397
xor r14d, r14d
lea r8, [rsp + 0x208]
lea rdx, [rsp + 0x100]
mov ecx, reloc.WS2_32.dll_socket
call qword [sym.imp.WS2_32.dll_inet_pton]
mov ebx, 0x1c
test eax, eax
jle 0x1400c3397
mov word [rsp + 0x200], reloc.WS2_32.dll_socket
mov ecx, ebp
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0x202], ax
test r14, r14
je 0x1400c3397
mov rcx, r14
xor edx, edx
mov r8d, 0xa
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtoul]
mov dword [rsp + 0x218], eax
jmp 0x1400c3397