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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
call fcn.0040651c
mov di, word [ebp + 0x14]
mov dword [eax], 0
movzx eax, di
push eax
movzx eax, word [ebp + 0xc]
push dword [ebp + 0x10]
push eax
push dword [ebp + 8]
call fcn.00402260
mov esi, eax
add esp, 0x10
mov dword [ebp - 8], esi
test esi, esi
jle 0x4027f6
cmp word [0x41d1ec], 0
je 0x4024d0
test di, di
jne 0x4024e0
jmp 0x402800
push 1
push esi
call sub.WS2_32.dll_listen
test eax, eax
js 0x40280a
cmp word [0x41d1f0], 0
je 0x4025fa
lea eax, [ebp - 4]
push eax
push dword [0x41d1bc]
mov dword [ebp - 4], 0x10
push esi
call sub.WS2_32.dll_getsockname
test eax, eax
jns 0x402516
push str.local_getsockname_failed
call fcn.00402c20
add esp, 4
mov eax, dword [0x41effc]
movq xmm0, qword [str.listening_on__]
movq qword [eax], xmm0
mov eax, dword [0x41effc]
mov ecx, dword [0x411a90]
mov dword [eax + 8], ecx
mov eax, dword [0x41effc]
mov cx, word [0x411a94]
mov word [eax + 0xc], cx
mov eax, dword [0x41effc]
mov cl, byte [0x411a96]
mov byte [eax + 0xe], cl
mov eax, dword [0x41d1bc]
cmp dword [eax + 4], 0
je 0x402598
push dword [eax + 4]
call sub.WS2_32.dll_inet_ntoa
mov edx, eax
mov esi, eax
lea ebx, [ebx]
mov al, byte [edx]
inc edx
test al, al
jne 0x402570
mov edi, dword [0x41effc]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402580
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4025b1
mov edi, dword [0x41effc]
dec edi
nop
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4025a0
mov eax, dword [0x411a98]
mov dword [edi], eax
mov ecx, dword [0x41effc]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4025b8
mov eax, dword [str.___d_...]
mov dword [ecx], eax
mov eax, dword [0x411aa0]
mov dword [ecx + 4], eax
mov al, byte [0x411aa4]
mov byte [ecx + 8], al
mov eax, dword [0x41d1bc]
movzx eax, word [eax + 2]
push eax
call sub.WS2_32.dll_ntohs
movzx eax, ax
push eax
push dword [0x41effc]
call fcn.00402c20
add esp, 8
cmp word [0x41d1ec], 0
mov dword [ebp - 4], 0x10
push 0xfffffffffffffff5
je 0x402662
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call esi
push 0
push 0x41f020
call fcn.004072f0
add esp, 8
test eax, eax
jne 0x4027e2
mov edi, dword [ebp - 8]
lea eax, [ebp - 4]
push eax
push dword [0x41d1c0]
push 2
push 0x2000
push dword [0x41effc]
push edi
call sub.WS2_32.dll_recvfrom
push 0xfffffffffffffff5
call esi
push 0x10
push dword [0x41d1c0]
push edi
call sub.WS2_32.dll_connect
mov ebx, eax
jmp 0x4026a5
mov edi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call edi
push 0
push 0x41f020
call fcn.004072f0
add esp, 8
test eax, eax
jne 0x4027e2
mov esi, dword [ebp - 8]
lea eax, [ebp - 4]
push eax
push dword [0x41d1c0]
push esi
call sub.WS2_32.dll_accept
push 0xfffffffffffffff5
mov ebx, eax
call edi
push esi
call sub.WS2_32.dll_closesocket
mov edi, ebx
mov dword [ebp - 8], edi
test ebx, ebx
js 0x4027f0
push 0x40
push 0
push dword [0x41effc]
call fcn.00407370
mov ebx, dword [0x41effc]
add esp, 0xc
lea eax, [ebp - 4]
push eax
push dword [0x41d1bc]
add ebx, 0x20
push edi
mov dword [ebp - 0x10], ebx
mov dword [ebp - 4], 0x10
call sub.WS2_32.dll_getsockname
test eax, eax
jns 0x4026f3
push str.post_rcv_getsockname_failed
call fcn.00402c20
add esp, 4
mov eax, dword [0x41d1bc]
push dword [eax + 4]
call sub.WS2_32.dll_inet_ntoa
mov edx, ebx
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
lea eax, [eax + 1]
test cl, cl
jne 0x402704
mov eax, dword [0x41d1c0]
movzx eax, word [eax + 2]
push eax
call sub.WS2_32.dll_ntohs
movzx eax, ax
mov dword [ebp - 0xc], eax
mov eax, dword [0x41d1c0]
push dword [eax + 4]
call sub.WS2_32.dll_inet_ntoa
mov edx, dword [0x41effc]
mov cl, byte [eax]
mov byte [edx], cl
lea eax, [eax + 1]
lea edx, [edx + 1]
test cl, cl
jne 0x402738
movzx eax, word [0x41d1e0]
push eax
push dword [0x41effc]
call fcn.00402830
mov esi, eax
add esp, 8
mov dword [ebp - 0x14], esi
call fcn.0040651c
mov ecx, dword [ebp + 8]
xor ebx, ebx
mov dword [eax], 0
mov dword [ebp - 4], ebx
test ecx, ecx
je 0x40279f
lea edx, [esi + 0x1c0]
lea esi, [ebx + 0xc]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x402794
add ecx, 4
add edx, 4
sub esi, 4
jae 0x402781
jmp 0x402799
mov ebx, 1
mov esi, dword [ebp - 0x14]
mov dword [ebp - 4], ebx
mov ax, word [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
test ax, ax
je 0x4027b9
cmp cx, ax
je 0x4027b9
mov dword [ebp - 4], 1
jmp 0x402814
test ebx, ebx
jne 0x402814
movzx ecx, cx
push ecx
lea ecx, [esi + 0x100]
push ecx
push esi
push dword [ebp - 0x10]
push str.connect_to___s__from__s___s___d
call fcn.00402c20
add esp, 0x14
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.0040651c
mov edi, dword [ebp - 8]
mov dword [eax], 0x8a
push edi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
push str.UDP_listen_needs__p_arg
call fcn.004021c0
push str.local_listen_fuxored
call fcn.004021c0
movzx eax, cx
push eax
lea eax, [esi + 0x100]
push eax
push esi
push dword [ebp - 0x10]
push str.invalid_connection_to___s__from__s___s___d
call fcn.004021c0
int3