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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov edx, dword [ebp + 0xc]
push ebx
mov ecx, dword [ebp + 0x10]
push esi
push edi
mov edi, dword [ebp + 0x14]
mov eax, edi
and edx, 0xffff
and eax, 0xffff
mov dword [0x40fb38], 0
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
call fcn.004021b0
mov esi, eax
add esp, 0x10
test esi, esi
mov dword [ebp - 8], esi
jle 0x402791
cmp word [0x40fb28], 0
je 0x40243b
test di, di
jne 0x402454
push str.UDP_listen_needs__p_arg
jmp 0x40244c
push 1
push esi
call sub.WS2_32.dll_listen
test eax, eax
jge 0x402454
push str.local_listen_fuxored
call fcn.00401c10
add esp, 4
cmp word [0x40fb2a], 0
mov ebx, 0x10
je 0x402555
mov edx, dword [0x40fb00]
lea ecx, [ebp - 4]
push ecx
push edx
push esi
mov dword [ebp - 4], ebx
call sub.WS2_32.dll_getsockname
test eax, eax
jge 0x40248c
push str.local_getsockname_failed
call fcn.00401b80
add esp, 4
mov eax, dword [0x40fe20]
mov ecx, dword [str.listening_on__]
mov dword [eax], ecx
mov edx, dword [0x40c7e4]
mov dword [eax + 4], edx
mov ecx, dword [0x40c7e8]
mov dword [eax + 8], ecx
mov dx, word [0x40c7ec]
mov word [eax + 0xc], dx
mov cl, byte [0x40c7ee]
mov byte [eax + 0xe], cl
mov eax, dword [0x40fb00]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x4024d7
mov edx, ecx
push edx
call sub.WS2_32.dll_inet_ntoa
mov edi, eax
jmp 0x4024dc
mov edi, 0x40c7dc
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x40fe20]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.___d_...
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x40fe20]
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x40fb00]
mov cx, word [eax + 2]
push ecx
call sub.WS2_32.dll_ntohs
mov edx, dword [0x40fe20]
and eax, 0xffff
push eax
push edx
call fcn.00401b80
add esp, 8
cmp word [0x40fb28], 0
mov dword [ebp - 4], ebx
je 0x4025c5
mov eax, dword [0x40fb2c]
push eax
push 2
call fcn.00401c70
push 0
push 0x40fde0
call fcn.00403fc0
add esp, 0x10
test eax, eax
jne 0x40277e
mov edx, dword [0x40fb04]
mov eax, dword [0x40fe20]
mov esi, dword [ebp - 8]
lea ecx, [ebp - 4]
push ecx
push edx
push 2
push 0x2000
push eax
push esi
call sub.WS2_32.dll_recvfrom
push 0
push 0
call fcn.00401c70
mov ecx, dword [0x40fb04]
add esp, 8
push ebx
push ecx
push esi
call sub.WS2_32.dll_connect
mov edi, eax
jmp 0x402617
mov edx, dword [0x40fb2c]
push edx
push 2
call fcn.00401c70
push 0
push 0x40fde0
call fcn.00403fc0
add esp, 0x10
test eax, eax
jne 0x40277e
mov ecx, dword [0x40fb04]
mov esi, dword [ebp - 8]
lea eax, [ebp - 4]
push eax
push ecx
push esi
call sub.WS2_32.dll_accept
push 0
push 0
mov edi, eax
call fcn.00401c70
add esp, 8
push esi
call sub.WS2_32.dll_closesocket
mov dword [ebp - 8], edi
mov esi, edi
test edi, edi
jl 0x40278b
mov edi, dword [0x40fe20]
mov ecx, ebx
xor eax, eax
rep stosd dword es:[edi], eax
mov edx, dword [0x40fe20]
mov ecx, dword [0x40fb00]
lea eax, [ebp - 4]
mov dword [ebp - 4], 0x10
push eax
lea ebx, [edx + 0x20]
push ecx
push esi
mov dword [ebp - 0xc], ebx
call sub.WS2_32.dll_getsockname
test eax, eax
jge 0x402660
push str.post_rcv_getsockname_failed
call fcn.00401b80
add esp, 4
mov edx, dword [0x40fb00]
mov eax, dword [edx + 4]
push eax
call sub.WS2_32.dll_inet_ntoa
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [0x40fb04]
mov cx, word [eax + 2]
push ecx
call sub.WS2_32.dll_ntohs
mov edx, dword [0x40fb04]
mov ebx, eax
mov eax, dword [edx + 4]
push eax
call sub.WS2_32.dll_inet_ntoa
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, dword [0x40fe20]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ax, word [0x40fb22]
mov ecx, dword [0x40fe20]
push eax
push ecx
call fcn.00401d60
mov esi, dword [ebp + 8]
xor ecx, ecx
add esp, 8
cmp esi, ecx
mov dword [ebp - 0x10], eax
mov dword [0x40fb38], ecx
mov dword [ebp - 4], ecx
je 0x402714
mov ecx, 4
lea edi, [eax + 0x1c0]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x402714
mov dword [ebp - 4], 1
mov ecx, dword [ebp + 0xc]
test cx, cx
je 0x402728
cmp bx, cx
je 0x402728
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x402754
mov ecx, ebx
lea edx, [eax + 0x100]
and ecx, 0xffff
push ecx
push edx
push eax
mov eax, dword [ebp - 0xc]
push eax
push str.invalid_connection_to___s__from__s___s___d
call fcn.00401c10
mov eax, dword [ebp - 0x10]
add esp, 0x14
mov edx, dword [ebp - 0xc]
and ebx, 0xffff
lea ecx, [eax + 0x100]
push ebx
push ecx
push eax
push edx
push str.connect_to___s__from__s___s___d
call fcn.00401b80
mov eax, dword [ebp - 8]
add esp, 0x14
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 8]
mov dword [0x40fb38], 0x274c
push esi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret