Function at 0x415c20
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x378
mov rbp, qword [rcx]
xor esi, esi
lea r12, [rsp + 0x1e0]
lea r9, [rsp + 0xa0]
mov qword [r8], 0xffffffffffffffff
mov r14, r8
mov rbx, rcx
mov r8, r12
call fcn.00415ad0
test eax, eax
je 0x415c80
mov eax, esi
add rsp, 0x378
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rax, [rsp + 0xb0]
lea rcx, [r12 + 0x10]
lea r8, [rsp + 0x98]
mov rdx, rax
mov qword [rsp + 0x68], rax
call fcn.004154d0
test al, al
je 0x415f50
mov r8, qword [rsp + 0x68]
lea rdx, str.__Trying__s..._n
mov rcx, rbp
call fcn.00416ed0
cmp byte [rbp + 0x4ae], 0
jne 0x415ee0
mov rcx, qword [rsp + 0xa0]
call fcn.004158b0
cmp byte [rbp + 0x654], 0
jne 0x415de3
mov rax, qword [rbp + 0x2c0]
test rax, rax
je 0x415d16
xor r8d, r8d
mov rcx, qword [rbp + 0x2c8]
mov rdx, qword [rsp + 0xa0]
call rax
cmp eax, 2
je 0x415f40
test eax, eax
jne 0x416080
mov byte [rsp + 0x77], 0
mov rax, qword [rsp + 0xa0]
lea rdi, [rsp + 0x278]
mov ecx, 0x1f
mov r11d, dword [rsp + 0x1e0]
mov qword [rsp + 0xa8], 0
mov qword [rsp + 0x50], rax
mov rax, qword [rbx]
movzx r13d, word [rax + 0x270]
mov r15d, dword [rax + 0x274]
mov r10, qword [rax + 0x4f0]
mov qword [rsp + 0x58], rax
xor eax, eax
mov qword [rsp + 0x270], 0
rep stosq qword [rdi], rax
test r13w, r13w
jne 0x415f90
test r10, r10
jne 0x415f90
mov rcx, qword [rsp + 0x50]
mov edx, 1
call fcn.004248f0
call fcn.00420f10
cmp dword [rbx + 0x28c], 1
mov qword [rbx + 0x284], rax
jle 0x415dbd
mov edx, dword [rbx + 0x290]
mov rcx, rbp
call fcn.0041f540
cmp byte [rsp + 0x77], 0
jne 0x415dd1
cmp dword [rbx + 0xa4], 1
je 0x416110
mov rax, qword [rsp + 0xa0]
xor esi, esi
mov qword [r14], rax
jmp 0x415c61
mov rsi, qword [rsp + 0xa0]
mov dword [rsp + 0xe0], 1
lea r9, [rsp + 0xe0]
mov dword [rsp + 0x20], 4
mov r8d, 8
mov edx, 0xffff
mov rcx, rsi
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x416390
mov dword [rsp + 0x270], 1
mov ecx, dword [rbp + 0x658]
call fcn.00424980
imul eax, eax, 0x3e8
mov dword [rsp + 0x274], eax
mov ecx, dword [rbp + 0x65c]
mov dword [rsp + 0xe0], eax
call fcn.00424980
imul eax, eax, 0x3e8
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xc
lea r8, [rsp + 0x270]
mov edx, 0x98000004
mov rcx, rsi
mov dword [rsp + 0xe0], eax
mov dword [rsp + 0x278], eax
lea rax, [rsp + 0x160]
mov qword [rsp + 0x30], rax
call qword [sym.imp.WS2_32.dll_WSAIoctl]
test eax, eax
je 0x415ce5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
lea rdx, str.Failed_to_set_SIO_KEEPALIVE_VALS_on_fd__d:__d_n
mov r9d, eax
mov r8d, esi
mov rcx, rbp
call fcn.00416ed0
jmp 0x415ce5
mov rsi, qword [rbx]
lea r9, [rsp + 0x270]
mov r8d, 1
mov edx, 6
mov rcx, qword [rsp + 0xa0]
movzx eax, byte [rsi + 0x4ae]
mov dword [rsp + 0x20], 4
mov dword [rsp + 0x270], eax
call qword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
js 0x4163b0
lea rdx, str.TCP_NODELAY_set_n
mov rcx, rsi
call fcn.00416ed0
jmp 0x415ccb
mov byte [rsp + 0x77], 1
jmp 0x415d1b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rbx
mov edx, eax
mov edi, eax
call fcn.00423f60
lea rdx, str.sa_addr_inet_ntop___failed_with_errno__d:__s
mov rcx, rbp
mov r9, rax
mov r8d, edi
call fcn.00416f80
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00415a60
jmp 0x415c61
lea rdi, [rsp + 0xe0]
xor eax, eax
mov ecx, 0x10
test r10, r10
mov qword [rsp + 0x60], rdi
rep stosq qword [rdi], rax
je 0x4160a0
mov rcx, r10
mov dword [rsp + 0x80], r11d
mov qword [rsp + 0x78], r10
call sub.msvcrt.dll_strlen
cmp rax, 0xfe
mov r10, qword [rsp + 0x78]
mov r11d, dword [rsp + 0x80]
ja 0x4160a0
lea rsi, [0x004680d7]
mov ecx, 3
mov rdi, r10
repe cmpsb byte [rsi], byte [rdi]
jne 0x4162a0
lea rsi, [rsp + 0x270]
mov edx, dword [rbx + 0xa0]
add r10, 3
mov dword [rsp + 0x20], 0x100
mov r8, r10
mov ecx, r11d
mov r9, rsi
mov qword [rsp + 0x78], r10
call fcn.00424a20
cmp eax, 1
je 0x416498
mov r10, qword [rsp + 0x78]
jb 0x4164e5
cmp eax, 2
mov r11d, dword [rsp + 0x80]
jne 0x41647a
mov rcx, qword [rsp + 0x58]
lea rdx, str.Local_Interface__s_is_ip__s_using_address_family__i_n
mov dword [rsp + 0x20], r11d
mov r9, rsi
mov r8, r10
mov dword [rsp + 0x78], r11d
call fcn.00416ed0
mov r11d, dword [rsp + 0x78]
nop dword [rax]
cmp r11d, 2
je 0x416197
xor esi, esi
jmp 0x4160ac
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
mov esi, 0x2a
call fcn.00415a60
jmp 0x415c61
xor esi, esi
cmp r11d, 2
je 0x4164af
mov rdi, qword [sym.imp.WS2_32.dll_bind]
mov r8d, esi
mov rdx, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x50]
call rdi
test eax, eax
jns 0x4161e0
sub r15d, 1
test r15d, r15d
jle 0x416250
mov rcx, qword [rsp + 0x58]
lea rdx, str.Bind_to_local_port__hu_failed__trying_next_n
movzx r8d, r13w
add r13d, 1
call fcn.00416ed0
cmp word [rsp + 0xe0], 2
jne 0x4160b3
movzx ecx, r13w
call qword [sym.imp.WS2_32.dll_ntohs]
mov word [rsp + 0xe2], ax
jmp 0x4160b3
lea rdx, [r12 + 0x10]
mov r8d, dword [rsp + 0x1ec]
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x415dd1
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0xb
mov esi, eax
je 0x415dd1
jl 0x416156
lea eax, [rax - 0x2733]
cmp eax, 1
jbe 0x415dd1
mov edx, esi
mov rcx, rbx
call fcn.00423f60
mov r8, qword [rsp + 0x68]
lea rdx, str.Immediate_connect_fail_for__s:__s_n
mov r9, rax
mov rcx, rbp
call fcn.00416ed0
mov rdx, qword [rsp + 0xa0]
mov dword [rbp + 0x882c], esi
mov rcx, rbx
mov esi, 7
call fcn.00415a60
jmp 0x415c61
mov rax, qword [rsp + 0x60]
mov rdx, rsi
mov ecx, 2
lea r8, [rax + 4]
call fcn.00424a30
test eax, eax
jle 0x41607a
mov edx, 2
movzx ecx, r13w
mov esi, 0x10
mov word [rsp + 0xe0], dx
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0xe2], ax
jmp 0x4160ac
lea rdx, [rsp + 0x160]
xor eax, eax
mov ecx, 0x10
mov dword [rsp + 0x9c], pe_nt_image_headers64
lea r8, [rsp + 0x9c]
mov rdi, rdx
rep stosq qword [rdi], rax
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
js 0x4163d7
mov rcx, qword [rsp + 0x58]
lea rdx, str.Local_port:__hu_n
movzx r8d, r13w
call fcn.00416ed0
mov rax, qword [rsp + 0xa0]
mov byte [rbx + 0x27f], 1
mov qword [rsp + 0x50], rax
jmp 0x415d8b
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rdi, qword [rsp + 0x58]
mov esi, eax
mov rcx, rbx
mov edx, esi
mov dword [rdi + 0x882c], esi
call fcn.00423f60
lea rdx, str.bind_failed_with_errno__d:__s
mov r8d, esi
mov r9, rax
mov rcx, rdi
mov esi, 0x2d
call fcn.00416f80
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00415a60
jmp 0x415c61
lea rsi, str.host_
mov ecx, 5
mov rdi, r10
repe cmpsb byte [rsi], byte [rdi]
jne 0x416423
add r10, 5
cmp r11d, 2
mov esi, dword [rbx + 0x2a8]
je 0x4164d6
lea r9, [rsp + 0xa8]
xor r8d, r8d
mov rdx, r10
mov rcx, rbx
mov qword [rsp + 0x78], r10
mov dword [rsp + 0x80], r11d
call fcn.004177e0
mov rax, qword [rsp + 0xa8]
mov dword [rbx + 0x2a8], esi
mov r10, qword [rsp + 0x78]
test rax, rax
je 0x41647a
lea rsi, [rsp + 0x270]
mov rcx, qword [rax]
mov r8d, 0x100
mov qword [rsp + 0x88], r10
mov rdx, rsi
call fcn.00417640
mov rax, qword [rsp + 0xa8]
mov r11d, dword [rsp + 0x80]
lea rdx, str.Name__s_family__i_resolved_to__s_family__i_n
mov r10, qword [rsp + 0x88]
mov rdi, qword [rsp + 0x58]
mov rax, qword [rax]
mov r9d, r11d
mov dword [rsp + 0x78], r11d
mov r8, r10
mov rcx, rdi
mov eax, dword [rax + 4]
mov qword [rsp + 0x20], rsi
mov dword [rsp + 0x28], eax
call fcn.00416ed0
mov rdx, qword [rsp + 0xa8]
mov rcx, rdi
call fcn.00417a80
mov r11d, dword [rsp + 0x78]
jmp 0x416070
lea rdx, str.Failed_to_set_SO_KEEPALIVE_on_fd__d_n
mov r8, rsi
mov rcx, rbp
call fcn.00416ed0
jmp 0x415ce5
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rcx, rbx
mov edx, eax
call fcn.00423f60
lea rdx, str.Could_not_set_TCP_NODELAY:__s_n
mov r8, rax
mov rcx, rsi
call fcn.00416ed0
jmp 0x415ccb
call qword [sym.imp.WS2_32.dll_WSAGetLastError]
mov rdi, qword [rsp + 0x58]
mov esi, eax
mov rcx, rbx
mov edx, esi
mov dword [rdi + 0x882c], esi
call fcn.00423f60
lea rdx, str.getsockname___failed_with_errno__d:__s
mov r8d, esi
mov r9, rax
mov rcx, rdi
mov esi, 0x2d
call fcn.00416f80
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
call fcn.00415a60
jmp 0x415c61
lea rsi, [rsp + 0x270]
mov edx, dword [rbx + 0xa0]
mov dword [rsp + 0x20], 0x100
mov r8, r10
mov ecx, r11d
mov qword [rsp + 0x80], r10
mov r9, rsi
mov dword [rsp + 0x78], r11d
call fcn.00424a20
cmp eax, 1
je 0x416498
mov r11d, dword [rsp + 0x78]
mov r10, qword [rsp + 0x80]
jb 0x4162bb
cmp eax, 2
je 0x416047
jmp 0x4162bb
mov rcx, qword [rsp + 0x58]
lea rdx, str.Couldnt_bind_to__s
mov r8, r10
mov esi, 0x2d
call fcn.00416f80
jmp 0x416287
mov rdx, qword [rsp + 0xa0]
mov rcx, rbx
xor esi, esi
call fcn.00415a60
jmp 0x415c61
mov eax, 2
movzx ecx, r13w
mov sil, 0x10
mov word [rsp + 0xe0], ax
call qword [sym.imp.WS2_32.dll_htons]
mov word [rsp + 0xe2], ax
jmp 0x4160ac
mov dword [rbx + 0x2a8], 1
jmp 0x4162cb
mov rcx, qword [rsp + 0x58]
lea rdx, str.Couldnt_bind_to_interface__s
mov r8, r10
mov esi, 0x2d
call fcn.00416f80
jmp 0x416287