Function at 0x402af0
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 [0x40fcd4], 0
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
call fcn.004027a0
mov esi, eax
add esp, 0x10
test esi, esi
mov dword [ebp - 8], esi
jle 0x402ec1
cmp word [0x40fcbc], 0
je 0x402b4b
test di, di
jne 0x402b65
push str.UDP_listen_needs__p_arg
jmp 0x402b5d
push 1
push esi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jge 0x402b65
push str.local_listen_fuxored
call fcn.004021f0
add esp, 4
cmp word [0x40fcbe], 0
je 0x402c68
mov edx, dword [0x40fc94]
lea ecx, [ebp - 4]
push ecx
push edx
push esi
mov dword [ebp - 4], 0x10
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x402b9d
push str.local_getsockname_failed
call fcn.00402150
add esp, 4
mov eax, dword [0x40ffc0]
mov ecx, dword [str.listening_on__]
mov dword [eax], ecx
mov edx, dword [0x40c914]
mov dword [eax + 4], edx
mov ecx, dword [0x40c918]
mov dword [eax + 8], ecx
mov dx, word [0x40c91c]
mov word [eax + 0xc], dx
mov cl, byte [0x40c91e]
mov byte [eax + 0xe], cl
mov eax, dword [0x40fc94]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x402be9
mov edx, ecx
push edx
call dword [sym.imp.WS2_32.dll_inet_ntoa]
mov edi, eax
jmp 0x402bee
mov edi, 0x40c90c
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, dword [0x40ffc0]
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 [0x40ffc0]
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 [0x40fc94]
mov cx, word [eax + 2]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
mov edx, dword [0x40ffc0]
and eax, 0xffff
push eax
push edx
call fcn.00402150
add esp, 8
cmp word [0x40fcbc], 0
mov ebx, dword [sym.imp.WS2_32.dll_closesocket]
mov dword [ebp - 4], 0x10
je 0x402cf3
mov eax, dword [0x40fcc0]
push eax
push 2
call fcn.00402250
push 0
push 0x40ff80
call fcn.00404840
add esp, 0x10
test eax, eax
jne 0x402eb1
mov edx, dword [0x40fc98]
mov eax, dword [0x40ffc0]
mov edi, dword [ebp - 8]
lea ecx, [ebp - 4]
push ecx
push edx
push 2
push 0x2000
push eax
push edi
call dword [sym.imp.WS2_32.dll_recvfrom]
push 0
push 0
mov esi, eax
call fcn.00402250
mov eax, dword [0x40fcc0]
add esp, 8
cmp eax, 0x3e8
jae 0x402d41
mov ecx, dword [0x40fc98]
push 0x10
push ecx
push edi
call dword [sym.imp.WS2_32.dll_connect]
mov esi, eax
jmp 0x402d41
mov edx, dword [0x40fcc0]
push edx
push 2
call fcn.00402250
push 0
push 0x40ff80
call fcn.00404840
add esp, 0x10
test eax, eax
jne 0x402eb1
mov ecx, dword [0x40fc98]
mov edi, dword [ebp - 8]
lea eax, [ebp - 4]
push eax
push ecx
push edi
call dword [sym.imp.WS2_32.dll_accept]
push 0
push 0
mov esi, eax
call fcn.00402250
add esp, 8
push edi
call ebx
mov dword [ebp - 8], esi
test esi, esi
jl 0x402ebb
mov edi, dword [0x40ffc0]
mov ecx, 0x10
xor eax, eax
rep stosd dword es:[edi], eax
mov edx, dword [0x40ffc0]
mov ecx, dword [0x40fc94]
lea eax, [ebp - 4]
mov dword [ebp - 4], 0x10
lea ebx, [edx + 0x20]
mov edx, dword [ebp - 8]
push eax
push ecx
push edx
mov dword [ebp - 0xc], ebx
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jge 0x402d91
push str.post_rcv_getsockname_failed
call fcn.00402150
add esp, 4
mov eax, dword [0x40fc94]
mov ecx, dword [eax + 4]
push ecx
call dword [sym.imp.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 [0x40fc98]
mov cx, word [eax + 2]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
mov edx, dword [0x40fc98]
mov ebx, eax
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.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 [0x40ffc0]
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 [0x40fcb6]
mov ecx, dword [0x40ffc0]
push eax
push ecx
call fcn.00402340
mov esi, dword [ebp + 8]
xor ecx, ecx
add esp, 8
cmp esi, ecx
mov dword [ebp - 0x10], eax
mov dword [0x40fcd4], ecx
mov dword [ebp - 4], ecx
je 0x402e47
mov ecx, 4
lea edi, [eax + 0x1c0]
xor edx, edx
repe cmpsd dword [esi], dword es:[edi]
je 0x402e47
mov dword [ebp - 4], 1
mov ecx, dword [ebp + 0xc]
test cx, cx
je 0x402e5b
cmp bx, cx
je 0x402e5b
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x402e87
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.004021f0
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.00402150
mov eax, dword [ebp - 8]
add esp, 0x14
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [0x40fcd4], 0x274c
mov eax, dword [ebp - 8]
push eax
call ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret