Function at 0x4041aa
Capabilities:
Connect socket
Get local ipv4 addresses
Get socket information
Receive data
Receive data on socket

Disassembly:
push rbp
push rdi
push rbx
mov rbp, rsp
sub rsp, 0x60
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 qword [rbp - 8], 0
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
movzx ecx, word [rbp + 0x38]
movzx eax, word [rbp + 0x28]
mov rdx, qword [rbp + 0x30]
mov r9d, ecx
mov r8, rdx
mov edx, eax
mov rcx, qword [rbp + 0x20]
call fcn.00403de9
mov dword [rbp - 0x24], eax
test eax, eax
jg 0x40420e
mov eax, 0xffffffff
jmp 0x4046f0
movzx eax, word [0x0040d0c8]
test ax, ax
je 0x40422f
cmp word [rbp + 0x38], 0
jne 0x404256
lea rcx, str.UDP_listen_needs__p_arg
call fcn.004034e7
jmp 0x404256
movsxd rax, dword [rbp - 0x24]
mov edx, 1
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_listen]
call rax
mov ebx, eax
test ebx, ebx
jns 0x404256
lea rcx, str.local_listen_fuxored
call fcn.004034e7
movzx eax, word [0x0040d0ca]
test ax, ax
je 0x4043a5
mov dword [rbp - 0x1c], 0x10
mov rdx, qword [0x0040d088]
movsxd rax, dword [rbp - 0x24]
lea rcx, [rbp - 0x1c]
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_getsockname]
call rax
mov ebx, eax
test ebx, ebx
jns 0x40429d
lea rcx, str.local_getsockname_failed
call fcn.004033f9
lea rax, [0x0040db10]
mov rax, qword [rax]
movabs rdi, 0x6e696e657473696c
mov qword [rax], rdi
mov dword [rax + 8], 0x6e6f2067
mov word [rax + 0xc], 0x5b20
mov byte [rax + 0xe], 0
mov rax, qword [0x0040d088]
mov eax, dword [rax + 4]
test eax, eax
je 0x4042ff
mov rax, qword [0x0040d088]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov rdx, rax
lea rax, [0x0040db10]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strcat
jmp 0x404333
lea rax, [0x0040db10]
mov rdx, qword [rax]
mov rax, rdx
mov rcx, 0xffffffffffffffff
mov r8, rax
mov eax, 0
mov rdi, r8
repne scasb al, byte [rdi]
mov rax, rcx
not rax
sub rax, 1
add rax, rdx
mov dword [rax], 0x796e61
lea rax, [0x0040db10]
mov rdx, qword [rax]
mov rax, rdx
mov rcx, 0xffffffffffffffff
mov r8, rax
mov eax, 0
mov rdi, r8
repne scasb al, byte [rdi]
mov rax, rcx
not rax
sub rax, 1
add rax, rdx
movabs rbx, 0x2e2e2e206425205d
mov qword [rax], rbx
mov byte [rax + 8], 0
mov rax, qword [0x0040d088]
movzx eax, word [rax + 2]
movzx eax, ax
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_ntohs]
call rax
mov word [rbp - 0xa], ax
movzx edx, word [rbp - 0xa]
lea rax, [0x0040db10]
mov rax, qword [rax]
mov rcx, rax
call fcn.004033f9
movzx eax, word [0x0040d0c8]
test ax, ax
je 0x40445f
mov dword [rbp - 0x1c], 0x10
mov eax, dword [0x0040d0cc]
mov edx, eax
mov ecx, 2
call fcn.00403611
mov rax, rbp
mov rdx, rax
lea rax, [0x0040db40]
mov rcx, rax
call sub.msvcrt.dll__setjmp
test eax, eax
je 0x4043ec
jmp 0x4046b4
mov rcx, qword [0x0040d090]
lea rax, [0x0040db10]
mov rdx, qword [rax]
mov edi, dword [rbp - 0x24]
mov eax, edi
cdqe
lea r8, [rbp - 0x1c]
mov qword [rsp + 0x28], r8
mov qword [rsp + 0x20], rcx
mov r9d, 2
mov r8d, 0x2000
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_recvfrom]
call rax
mov ebx, eax
mov edx, 0
mov ecx, 0
call fcn.00403611
mov rdx, qword [0x0040d090]
mov eax, edi
cdqe
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_connect]
call rax
mov ebx, eax
jmp 0x4044f2
mov dword [rbp - 0x1c], 0x10
mov eax, dword [0x0040d0cc]
mov edx, eax
mov ecx, 2
call fcn.00403611
mov rax, rbp
mov rdx, rax
lea rax, [0x0040db40]
mov rcx, rax
call sub.msvcrt.dll__setjmp
test eax, eax
jne 0x4044ed
mov rdx, qword [0x0040d090]
mov edi, dword [rbp - 0x24]
mov eax, edi
cdqe
lea rcx, [rbp - 0x1c]
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_accept]
call rax
mov ebx, eax
mov edx, 0
mov ecx, 0
call fcn.00403611
mov eax, edi
cdqe
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, edi
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov dword [rbp - 0x24], ebx
jmp 0x4044f2
jmp 0x4046b4
test ebx, ebx
jns 0x4044fb
jmp 0x4046c3
lea rax, [0x0040db10]
mov rax, qword [rax]
mov r8d, 0x40
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_memset
lea rax, [0x0040db10]
mov rax, qword [rax]
add rax, 0x20
mov qword [rbp - 0x18], rax
mov dword [rbp - 0x1c], 0x10
mov rdx, qword [0x0040d088]
movsxd rax, dword [rbp - 0x24]
lea rcx, [rbp - 0x1c]
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_getsockname]
call rax
mov ebx, eax
test ebx, ebx
jns 0x404561
lea rcx, str.post_rcv_getsockname_failed
call fcn.004033f9
mov rax, qword [0x0040d088]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov rdx, rax
mov rax, qword [rbp - 0x18]
mov rcx, rax
call sub.msvcrt.dll_strcpy
mov rax, qword [0x0040d090]
movzx eax, word [rax + 2]
movzx eax, ax
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_ntohs]
call rax
mov word [rbp - 0xa], ax
mov rax, qword [0x0040d090]
mov eax, dword [rax + 4]
mov ecx, eax
mov rax, qword [sym.imp.WSOCK32.dll_inet_ntoa]
call rax
mov rdx, rax
lea rax, [0x0040db10]
mov rax, qword [rax]
mov rcx, rax
call sub.msvcrt.dll_strcpy
movzx eax, word [0x0040d0c2]
movzx edx, ax
lea rax, [0x0040db10]
mov rax, qword [rax]
mov rcx, rax
call fcn.00403760
mov qword [rbp - 8], rax
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0
mov dword [rbp - 0x1c], 0
cmp qword [rbp + 0x20], 0
je 0x404630
mov rax, qword [rbp - 8]
add rax, 0x1c0
mov r8d, 0x10
mov rdx, rax
mov rcx, qword [rbp + 0x20]
call sub.msvcrt.dll_memcmp
test eax, eax
je 0x404630
mov dword [rbp - 0x1c], 1
cmp word [rbp + 0x28], 0
je 0x404648
movzx eax, word [rbp - 0xa]
cmp ax, word [rbp + 0x28]
je 0x404648
mov dword [rbp - 0x1c], 1
mov eax, dword [rbp - 0x1c]
test eax, eax
je 0x40467f
movzx edx, word [rbp - 0xa]
mov rax, qword [rbp - 8]
lea r8, [rax + 0x100]
mov rcx, qword [rbp - 8]
mov rax, qword [rbp - 0x18]
mov dword [rsp + 0x20], edx
mov r9, r8
mov r8, rcx
mov rdx, rax
lea rcx, str.invalid_connection_to___s__from__s___s___d
call fcn.004034e7
movzx edx, word [rbp - 0xa]
mov rax, qword [rbp - 8]
lea r8, [rax + 0x100]
mov rcx, qword [rbp - 8]
mov rax, qword [rbp - 0x18]
mov dword [rsp + 0x20], edx
mov r9, r8
mov r8, rcx
mov rdx, rax
lea rcx, str.connect_to___s__from__s___s___d
call fcn.004033f9
mov eax, dword [rbp - 0x24]
jmp 0x4046f0
mov rax, qword [sym.imp.msvcrt.dll__errno]
call rax
mov dword [rax], 0x274c
mov ebx, dword [rbp - 0x24]
mov eax, ebx
cdqe
mov edx, 2
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_shutdown]
call rax
mov eax, ebx
cdqe
mov rcx, rax
mov rax, qword [sym.imp.WSOCK32.dll_closesocket]
call rax
mov eax, 0xffffffff
add rsp, 0x60
pop rbx
pop rdi
pop rbp
ret