Function at 0x403e86
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Set socket configuration

Disassembly:
push rbp
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x40
mov qword [rbp + 0x20], rcx
mov eax, edx
mov qword [rbp + 0x30], r8
mov edx, r9d
mov word [rbp + 0x28], ax
mov eax, edx
mov word [rbp + 0x38], ax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
mov ecx, 0
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
movzx eax, word [0x0040d0c8]
test ax, ax
je 0x403ef6
mov r8d, 0x11
mov edx, 2
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov edx, eax
lea rax, [0x0040da64]
mov dword [rax], edx
jmp 0x403f1a
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov edx, eax
lea rax, [0x0040da64]
mov dword [rax], edx
lea rax, [0x0040da64]
mov eax, dword [rax]
test eax, eax
jns 0x403f33
lea rcx, str.Cant_get_socket
call fcn.0040359c
lea rax, [0x0040da64]
mov eax, dword [rax]
test eax, eax
jne 0x403f5b
lea rax, [0x0040da64]
mov eax, dword [rax]
mov ecx, eax
call sub.msvcrt.dll__dup
mov edx, eax
lea rax, [0x0040da64]
mov dword [rax], edx
lea rax, [0x0040db90]
mov rdx, qword [rax]
lea rax, [0x0040da64]
mov eax, dword [rax]
cdqe
mov dword [rsp + 0x20], 8
mov r9, rdx
mov r8d, 4
mov edx, 0xffff
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_setsockopt]
call rax
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x403fa5
lea rcx, str.nnetfd_reuseaddr_failed
call fcn.004034a4
mov rax, qword [0x0040d088]
mov word [rax], 2
mov rax, qword [0x0040d090]
mov word [rax], 2
cmp qword [rbp + 0x30], 0
je 0x403fd7
mov rax, qword [0x0040d088]
add rax, 4
mov rdx, qword [rbp + 0x30]
mov edx, dword [rdx]
mov dword [rax], edx
cmp word [rbp + 0x38], 0
je 0x403ff8
movzx eax, word [rbp + 0x38]
mov rbx, qword [0x0040d088]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_htons]
call rax
mov word [rbx + 2], ax
mov ebx, 0
cmp qword [rbp + 0x30], 0
jne 0x40400f
cmp word [rbp + 0x38], 0
je 0x4040ba
movzx eax, word [rbp + 0x38]
mov dword [rbp - 8], eax
mov dword [rbp - 4], 4
jmp 0x4040aa
mov rdx, qword [0x0040d088]
lea rax, [0x0040da64]
mov eax, dword [rax]
cdqe
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_bind]
call rax
mov ebx, eax
test ebx, ebx
je 0x4040b6
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
cmp eax, 0x2740
jne 0x4040b9
movzx esi, word [rbp + 0x38]
mov rax, qword [0x0040d088]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov r8d, esi
mov rdx, rax
lea rcx, str.retrying_local__s:_d
call fcn.004034a4
mov ecx, 1
mov rax, qword [sym.imp.msvcrt.dll__sleep]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
sub dword [rbp - 4], 1
cmp dword [rbp - 4], 0
jg 0x404022
jmp 0x4040ba
nop
jmp 0x4040ba
nop
test ebx, ebx
je 0x4040e9
movzx ebx, word [rbp + 0x38]
mov rax, qword [0x0040d088]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov r8d, ebx
mov rdx, rax
lea rcx, str.Cant_grab__s:_d_with_bind
call fcn.0040359c
movzx eax, word [0x0040d0c0]
test ax, ax
je 0x404103
lea rax, [0x0040da64]
mov eax, dword [rax]
jmp 0x40422f
mov rax, qword [0x0040d090]
add rax, 4
mov rdx, qword [rbp + 0x20]
mov edx, dword [rdx]
mov dword [rax], edx
movzx eax, word [rbp + 0x28]
mov rbx, qword [0x0040d090]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_htons]
call rax
mov word [rbx + 2], ax
mov eax, dword [0x0040d068]
test eax, eax
je 0x404146
lea rcx, str.Warning:_source_routing_unavailable_on_this_machine__ignoring
call fcn.004034a4
mov eax, dword [0x0040d0cc]
mov edx, eax
mov ecx, 1
call fcn.004036c6
mov rax, rbp
mov rdx, rax
lea rax, [0x0040da80]
mov rcx, rax
call sub.msvcrt.dll__setjmp
test eax, eax
jne 0x404199
mov rdx, qword [0x0040d090]
lea rax, [0x0040da64]
mov eax, dword [rax]
cdqe
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_connect]
call rax
mov ebx, eax
jmp 0x4041ac
mov ebx, 0xffffffff
mov ecx, 0x274c
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov edx, 0
mov ecx, 0
call fcn.004036c6
test ebx, ebx
jne 0x4041ca
lea rax, [0x0040da64]
mov eax, dword [rax]
jmp 0x40422f
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov rbx, rax
mov rax, qword [sym.imp.WSOCK32.dll_WSAGetLastError]
call rax
mov dword [rbx], eax
lea rax, [0x0040da64]
mov eax, dword [rax]
cdqe
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
lea rax, [0x0040da64]
mov eax, dword [rax]
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov eax, 0xffffffff
add rsp, 0x40
pop rbx
pop rsi
pop rbp
ret