Function at 0x4027f0
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 ecx, dword [ebp + 0x10]
movzx edx, word [ebp + 0xc]
push ebx
push esi
push edi
mov di, word [ebp + 0x14]
movzx eax, di
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
mov dword [0x40e7cc], 0
call fcn.004025d0
mov esi, eax
add esp, 0x10
test esi, esi
mov dword [ebp - 8], esi
jle 0x402b6a
cmp word [0x40e7b0], 0
je 0x402846
test di, di
jne 0x40285c
push str.UDP_listen_needs__p_arg
call fcn.004020f0
push 1
push esi
call sub.WS2_32.dll_listen
test eax, eax
jge 0x40285c
push str.local_listen_fuxored
call fcn.004020f0
cmp word [0x40e7b4], 0
mov ebx, 0x10
je 0x40296d
mov edx, dword [0x40e780]
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 0x402894
push str.local_getsockname_failed
call fcn.00402060
add esp, 4
mov ecx, dword [str.listening_on__]
mov eax, dword [0x40ea40]
mov dword [eax], ecx
mov edx, dword [0x40ba40]
mov dword [eax + 4], edx
mov ecx, dword [0x40ba44]
mov dword [eax + 8], ecx
mov dx, word [0x40ba48]
mov word [eax + 0xc], dx
mov cl, byte [0x40ba4a]
mov byte [eax + 0xe], cl
mov eax, dword [0x40e780]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x40290a
mov edx, ecx
push edx
call sub.WS2_32.dll_inet_ntoa
mov edx, eax
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4028e0
mov edi, dword [0x40ea40]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x4028f0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x402920
mov edi, dword [0x40ea40]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402911
mov eax, dword [0x40ba38]
mov dword [edi], eax
mov edi, dword [0x40ea40]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402927
mov ecx, dword [str.___d_...]
mov dword [edi], ecx
mov edx, dword [0x40ba30]
mov dword [edi + 4], edx
mov al, byte [0x40ba34]
mov byte [edi + 8], al
mov ecx, dword [0x40e780]
xor edx, edx
mov dx, word [ecx + 2]
push edx
call sub.WS2_32.dll_ntohs
mov ecx, dword [0x40ea40]
movzx eax, ax
push eax
push ecx
call fcn.00402060
add esp, 8
cmp word [0x40e7b0], 0
push 0xfffffffffffffff5
mov dword [ebp - 4], ebx
je 0x4029d3
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call esi
push 0
push 0x40ea00
call fcn.00404828
add esp, 8
test eax, eax
jne 0x402b4f
mov eax, dword [0x40e784]
mov ecx, dword [0x40ea40]
mov ebx, dword [ebp - 8]
lea edx, [ebp - 4]
push edx
push eax
push 2
push 0x2000
push ecx
push ebx
call sub.WS2_32.dll_recvfrom
push 0xfffffffffffffff5
call esi
mov edx, dword [0x40e784]
push 0x10
push edx
push ebx
call sub.WS2_32.dll_connect
mov esi, eax
jmp 0x402a1f
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call ebx
push 0
push 0x40ea00
call fcn.00404828
add esp, 8
test eax, eax
jne 0x402b4f
mov ecx, dword [0x40e784]
mov edi, dword [ebp - 8]
lea eax, [ebp - 4]
push eax
push ecx
push edi
call sub.WS2_32.dll_accept
push 0xfffffffffffffff5
mov esi, eax
call ebx
push 2
push edi
call sub.WS2_32.dll_shutdown
push edi
call sub.WS2_32.dll_closesocket
mov ebx, esi
mov dword [ebp - 8], ebx
test esi, esi
jl 0x402b5c
mov edi, dword [0x40ea40]
xor eax, eax
mov ecx, 0x10
rep stosd dword es:[edi], eax
mov eax, dword [0x40e780]
mov esi, dword [0x40ea40]
lea edx, [ebp - 4]
push edx
push eax
add esi, 0x20
push ebx
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], 0x10
call sub.WS2_32.dll_getsockname
test eax, eax
jge 0x402a6a
push str.post_rcv_getsockname_failed
call fcn.00402060
add esp, 4
mov ecx, dword [0x40e780]
mov edx, dword [ecx + 4]
push edx
call sub.WS2_32.dll_inet_ntoa
mov edx, esi
jmp 0x402a80
mov cl, byte [eax]
inc eax
mov byte [edx], cl
inc edx
test cl, cl
jne 0x402a80
mov eax, dword [0x40e784]
xor ecx, ecx
mov cx, word [eax + 2]
push ecx
call sub.WS2_32.dll_ntohs
mov edx, dword [0x40e784]
mov edi, eax
mov eax, dword [edx + 4]
push eax
mov dword [ebp - 0xc], edi
call sub.WS2_32.dll_inet_ntoa
mov edx, dword [0x40ea40]
mov cl, byte [eax]
inc eax
mov byte [edx], cl
inc edx
test cl, cl
jne 0x402ab5
movzx ecx, word [0x40e7a4]
mov edx, dword [0x40ea40]
push ecx
push edx
call fcn.004021a0
mov esi, dword [ebp + 8]
xor ecx, ecx
add esp, 8
test esi, esi
mov dword [0x40e7cc], ecx
mov dword [ebp - 4], ecx
je 0x402b03
mov ecx, 4
lea edi, [eax + 0x1c0]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
mov edi, dword [ebp - 0xc]
je 0x402b03
mov dword [ebp - 4], 1
mov cx, word [ebp + 0xc]
test cx, cx
je 0x402b18
cmp di, cx
je 0x402b18
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 4]
test ecx, ecx
movzx ecx, di
push ecx
lea edx, [eax + 0x100]
push edx
push eax
mov eax, dword [ebp - 0x10]
push eax
je 0x402b39
push str.invalid_connection_to___s__from__s___s___d
call fcn.004020f0
push str.connect_to___s__from__s___s___d
call fcn.00402060
add esp, 0x14
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 8]
mov dword [0x40e7cc], 0x274c
push 2
push ebx
call sub.WS2_32.dll_shutdown
push ebx
call sub.WS2_32.dll_closesocket
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret