Function at 0x401a50
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
push ebx
push esi
push edi
mov di, word [ebp + 0x14]
call fcn.00403db7
mov ecx, dword [ebp + 0x10]
movzx edx, word [ebp + 0xc]
mov dword [eax], 0
movzx eax, di
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
call fcn.00401820
mov esi, eax
add esp, 0x10
mov dword [ebp - 8], esi
test esi, esi
jle 0x401ddc
cmp word [0x414b1c], 0
je 0x401aa7
test di, di
jne 0x401abd
push str.UDP_listen_needs__p_arg
call fcn.00401340
push 1
push esi
call sub.WS2_32.dll_listen
test eax, eax
jge 0x401abd
push str.local_listen_fuxored
call fcn.00401340
cmp word [0x414b20], 0
mov ebx, 0x10
je 0x401bc6
mov edx, dword [0x414af0]
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 0x401af5
push str.local_getsockname_failed
call fcn.004012a0
add esp, 4
mov ecx, dword [str.listening_on__]
mov eax, dword [0x415ce0]
mov dword [eax], ecx
mov edx, dword [0x410d1c]
mov dword [eax + 4], edx
mov ecx, dword [0x410d20]
mov dword [eax + 8], ecx
mov dx, word [0x410d24]
mov word [eax + 0xc], dx
mov cl, byte [0x410d26]
mov edx, dword [0x414af0]
mov byte [eax + 0xe], cl
cmp dword [edx + 4], 0
je 0x401b73
mov edx, dword [edx + 4]
push edx
call sub.WS2_32.dll_inet_ntoa
mov ecx, eax
nop
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x401b40
sub eax, ecx
mov edx, eax
mov eax, dword [0x415ce0]
mov edi, eax
mov esi, ecx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401b55
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [0x414af0]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x401b86
mov edi, eax
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x401b76
mov ecx, dword [0x410d28]
mov dword [edi], ecx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x401b87
mov ecx, dword [str.___d_...]
mov dword [eax], ecx
mov ecx, dword [0x410d30]
mov dword [eax + 4], ecx
mov cl, byte [0x410d34]
mov byte [eax + 8], cl
movzx edx, word [edx + 2]
push edx
call sub.WS2_32.dll_ntohs
mov ecx, dword [0x415ce0]
movzx eax, ax
push eax
push ecx
call fcn.004012a0
add esp, 8
cmp word [0x414b1c], 0
mov dword [ebp - 4], ebx
push 0xfffffffffffffff5
je 0x401c2b
mov esi, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call esi
push 0
push 0x415ca0
call fcn.0040edf0
add esp, 8
test eax, eax
jne 0x401dc0
mov eax, dword [0x414af4]
mov ecx, dword [0x415ce0]
mov edi, dword [ebp - 8]
lea edx, [ebp - 4]
push edx
push eax
push 2
push 0x2000
push ecx
push edi
call sub.WS2_32.dll_recvfrom
push 0xfffffffffffffff5
call esi
mov edx, dword [0x414af4]
push ebx
push edx
push edi
call sub.WS2_32.dll_connect
mov esi, eax
jmp 0x401c7c
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
call ebx
push 0
push 0x415ca0
call fcn.0040edf0
add esp, 8
test eax, eax
jne 0x401dc0
mov ecx, dword [0x414af4]
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 edi, esi
mov dword [ebp - 8], edi
mov ebx, 0x10
test esi, esi
jl 0x401dce
mov esi, dword [0x415ce0]
push 0x40
push 0
push esi
call fcn.0040a730
mov eax, dword [0x414af0]
add esp, 0xc
lea edx, [ebp - 4]
push edx
push eax
add esi, 0x20
push edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 4], ebx
call sub.WS2_32.dll_getsockname
test eax, eax
jge 0x401cc1
push str.post_rcv_getsockname_failed
call fcn.004012a0
add esp, 4
mov ecx, dword [0x414af0]
mov edx, dword [ecx + 4]
push edx
call sub.WS2_32.dll_inet_ntoa
mov edx, esi
mov cl, byte [eax]
mov byte [edx], cl
inc eax
inc edx
test cl, cl
jne 0x401cd2
mov eax, dword [0x414af4]
movzx ecx, word [eax + 2]
push ecx
call sub.WS2_32.dll_ntohs
mov edx, dword [0x414af4]
movzx ebx, ax
mov eax, dword [edx + 4]
push eax
mov dword [ebp - 0xc], ebx
call sub.WS2_32.dll_inet_ntoa
mov ecx, dword [0x415ce0]
mov esi, ecx
mov dl, byte [eax]
mov byte [esi], dl
inc eax
inc esi
test dl, dl
jne 0x401d08
movzx eax, word [0x414b10]
call fcn.004013e0
mov esi, eax
call fcn.00403db7
mov edx, dword [ebp + 8]
mov dword [eax], 0
mov dword [ebp - 4], 0
test edx, edx
je 0x401d64
lea eax, [esi + 0x1c0]
mov ecx, 0x10
sub edx, eax
mov ebx, dword [edx + eax]
cmp ebx, dword [eax]
jne 0x401d5a
sub ecx, 4
add eax, 4
cmp ecx, 4
jae 0x401d46
jmp 0x401d61
mov dword [ebp - 4], 1
mov ebx, dword [ebp - 0xc]
mov ax, word [ebp + 0xc]
test ax, ax
je 0x401d7b
cmp bx, ax
je 0x401d7b
mov dword [ebp - 4], 1
jmp 0x401d81
cmp dword [ebp - 4], 0
je 0x401d9b
mov edx, dword [ebp - 0x10]
movzx ecx, bx
push ecx
push edx
lea ecx, [esi + 0x100]
push str.invalid_connection_to___s__from__s___s___d
mov edx, esi
call fcn.00401340
mov ecx, dword [ebp - 0x10]
lea eax, [esi + 0x100]
push eax
push esi
push ecx
movzx edx, bx
push str.connect_to___s__from__s___s___d
call fcn.004012a0
add esp, 0x10
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00403db7
mov edi, dword [ebp - 8]
mov dword [eax], 0x274c
push 2
push edi
call sub.WS2_32.dll_shutdown
push edi
call sub.WS2_32.dll_closesocket
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret