Function at 0x403de9
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 word [rbp + 0x38], dx
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 0x403e57
mov r8d, 0x11
mov edx, 2
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov edx, eax
lea rax, [0x0040db04]
mov dword [rax], edx
jmp 0x403e7b
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WSOCK32.dll_socket]
call rax
mov edx, eax
lea rax, [0x0040db04]
mov dword [rax], edx
lea rax, [0x0040db04]
mov eax, dword [rax]
test eax, eax
jns 0x403e94
lea rcx, str.Cant_get_socket
call fcn.004034e7
lea rax, [0x0040db04]
mov eax, dword [rax]
test eax, eax
jne 0x403ebc
lea rax, [0x0040db04]
mov eax, dword [rax]
mov ecx, eax
call sub.msvcrt.dll__dup
mov edx, eax
lea rax, [0x0040db04]
mov dword [rax], edx
lea rax, [0x0040dc50]
mov rdx, qword [rax]
lea rax, [0x0040db04]
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 0x403f06
lea rcx, str.nnetfd_reuseaddr_failed
call fcn.004033f9
mov rax, qword [0x0040d088]
mov word [rax], 2
mov rax, qword [0x0040d090]
mov word [rax], 2
cmp qword [rbp + 0x30], 0
je 0x403f42
mov rax, qword [0x0040d088]
lea rcx, [rax + 4]
mov rax, qword [rbp + 0x30]
mov r8d, 4
mov rdx, rax
call sub.msvcrt.dll_memcpy
cmp word [rbp + 0x38], 0
je 0x403f63
mov rbx, qword [0x0040d088]
movzx eax, word [rbp + 0x38]
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 0x403f7a
cmp word [rbp + 0x38], 0
je 0x404023
movzx eax, word [rbp + 0x38]
mov dword [rbp - 8], eax
mov dword [rbp - 4], 4
jmp 0x404019
mov rdx, qword [0x0040d088]
lea rax, [0x0040db04]
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
jne 0x403fb9
jmp 0x404023
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov eax, dword [rax]
cmp eax, 0x2740
je 0x403fcd
jmp 0x404023
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.004033f9
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 0x403f8d
test ebx, ebx
je 0x404052
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.004034e7
movzx eax, word [0x0040d0c0]
test ax, ax
je 0x40406c
lea rax, [0x0040db04]
mov eax, dword [rax]
jmp 0x4041a2
mov rax, qword [0x0040d090]
add rax, 4
mov r8d, 4
mov rdx, qword [rbp + 0x20]
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rbx, qword [0x0040d090]
movzx eax, word [rbp + 0x28]
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 0x4040b9
lea rcx, str.Warning:_source_routing_unavailable_on_this_machine__ignoring
call fcn.004033f9
mov eax, dword [0x0040d0cc]
mov edx, eax
mov ecx, 1
call fcn.00403611
mov rax, rbp
mov rdx, rax
lea rax, [0x0040db40]
mov rcx, rax
call sub.msvcrt.dll__setjmp
test eax, eax
jne 0x40410c
mov rdx, qword [0x0040d090]
lea rax, [0x0040db04]
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 0x40411f
mov ebx, 0xffffffff
mov ecx, 0x274c
mov rax, qword [sym.imp.WSOCK32.dll_WSASetLastError]
call rax
mov edx, 0
mov ecx, 0
call fcn.00403611
test ebx, ebx
jne 0x40413d
lea rax, [0x0040db04]
mov eax, dword [rax]
jmp 0x4041a2
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, [0x0040db04]
mov eax, dword [rax]
cdqe
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
lea rax, [0x0040db04]
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