Function at 0x404a86
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
test esi, esi
jge 0x404b19
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
jmp 0x404d38
push edi
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
push 0x10
lea eax, [ebp - 0x10]
push 0
push eax
call fcn.0040c9b0
add esp, 0xc
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
mov word [ebp - 0x10], 2
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0xc], eax
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
push dword [ebp + 0xc]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
lea eax, [ebp - 0x10]
push 0x10
push eax
push esi
call dword [sym.imp.WS2_32.dll_connect]
mov edi, eax
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
test edi, edi
pop edi
je 0x404d3d
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
push esi
call dword [sym.imp.WS2_32.dll_closesocket]
sub eax, dword [0x4160e4]
add ecx, dword [0x4160ec]
inc ecx
mov ebx, ebx
sub edx, dword [0x4160e8]
sub ecx, dword [0x4160ec]
add edx, dword [0x4160e8]
mov edx, edx
add ebx, dword [str.hBx]
add eax, dword [0x4160e4]
lea ebx, [ebx]
sub ebx, dword [str.hBx]
lea ecx, [ecx]
dec ecx
or eax, 0xffffffff
jmp 0x404d3f
mov eax, esi
pop esi
pop ebx
leave
ret