miércoles, 17 de agosto de 2011

Codigo Fuente de b0t by gUachorrO;x1 Vb 2008

Bueno acá les dejo el codigo de fuente de mi b0t


Imports System.Text
Imports System.Net.Sockets
Imports System.Net
Imports System.IO

Public Class Form1
    Public Conection As Net.Sockets.Socket
    Public thread As Threading.Thread
    Dim Index As Integer = 0
    Dim enable As Boolean = False
    Dim user = New Class2
    Dim RTA2 = New List(Of Byte)
    Dim RTA = New List(Of Byte)
   
    Dim Usuariosenlasala As New List(Of Class2)
    Dim info = New RoomInfo
      Dim v As New List(Of Byte)
    Dim l As Integer




    Private Sub recivimiento()
        While True
            Dim buffer As Byte()

            buffer = New Byte(8192) {}

            Dim success As SocketError = SocketError.Success
            Dim num As Integer = 0
            num = Conection.Receive(buffer, 0, Conection.Available, SocketFlags.None, success)

            l += 1

            If (num = 0) Then






                If (success = SocketError.WouldBlock) Then
                    Me.l = 0

                ElseIf (Me.l + 1 + 1 > 3) Then


                    If Conection.Connected Then
                        Try
                            Conection.Disconnect(False)
                        Catch ex As Exception

                        End Try

                    End If
                    v.Clear()
                    Me.l = 0

                    enable = False
                    Exit Sub
                End If


            Else

                Me.l = 0
                Dim destinationArray As Byte() = New Byte(num - 1) {}
                Array.Copy(buffer, 0, destinationArray, 0, destinationArray.Length)
                Me.v.AddRange(destinationArray)
            End If




            Do While (Me.v.Count >= 3)


                buffer = Me.v.ToArray
                Dim num2 As UInt16 = BitConverter.ToUInt16(buffer, 0)
                Dim num3 As Byte = buffer(2)
                If (buffer.Length >= (num2 + 3)) Then
                    Dim buffer3 As Byte() = New Byte(num2 - 1) {}
                    Array.Copy(buffer, 3, buffer3, 0, buffer3.Length)
                    Me.v.RemoveRange(0, (num2 + 3))


                    If (num3 = 80) Then
                        'clearscreen

                    End If


                    Try


                        Bytespackt(num3, New Class1(buffer3))

                        Continue Do
                    Catch ex As Exception
                    End Try

                Else
                    ' v.Clear()
                    Exit Do
                End If
                Return
            Loop

            ' v.Clear()

        End While
    End Sub
    Private Delegate Sub IndexText2(ByVal Texto As String)

    Private Sub IndexText(ByVal Texto As String)
        If Me.InvokeRequired Then
            Me.BeginInvoke(New IndexText2(AddressOf IndexText), Texto)
        Else
            TextBox10.AppendText((Texto & vbNewLine))



        End If

    End Sub
    Public Delegate Sub listuser1(ByVal Texto As String)
    Private Sub listuser(ByVal Texto As String)
        If Me.InvokeRequired Then
            Me.BeginInvoke(New listuser1(AddressOf listuser), Texto)
        Else
            ListBox1.Items.Add(Texto & vbNewLine)
        End If
    End Sub
    Private Delegate Sub Topic2(ByVal Texto As String)
    Private Sub Topic(ByVal Texto As String)
        If Me.InvokeRequired Then

            Me.BeginInvoke(New Topic2(AddressOf Topic), Texto)
        Else
            TextBox2.AppendText(Texto & vbNewLine)
        End If


    End Sub
    Private Delegate Sub Url2(ByVal Texto As String)

    Private Sub Url(ByVal Texto As String)
        If Me.InvokeRequired Then
            Me.BeginInvoke(New Url2(AddressOf Url), Texto)
        Else
            TextBox3.Text = ""
            TextBox3.AppendText(Texto & vbNewLine)
        End If
    End Sub
    Private Sub urltext(ByVal Texto As String)
        If Me.InvokeRequired Then
            Me.BeginInvoke(New Url2(AddressOf urltext), Texto)
        Else
            TextBox7.Text = ""
            TextBox7.AppendText(Texto & vbNewLine)
        End If
    End Sub
    Private Delegate Sub motdtext2(ByVal texto As String)
    Private Sub motdtext(ByVal texto As String)
        If Me.InvokeRequired Then
            BeginInvoke(New motdtext2(AddressOf motdtext), texto)
            Dim asd As New AresPacketWriter
            asd.WriteString((texto))
            Conection.Send(asd.ToAresPacket(10))

        End If
    End Sub



    Private Sub Bytespackt(ByVal id As Byte, ByVal Datos As Class1)
        Select Case id
            Case 31
                Topic(Datos.ReadString)
            Case 32
                Topic(Datos.ReadString)

            Case 10
                user.Nombre = Datos.ReadString
                user.Texto = Datos.ReadString

                IndexText(user.nombre + ">" + user.texto)
                Dim aut As String = user.texto
                If Conection.Connected Then
                    If aut.StartsWith("@version") Then
                        Dim write As New AresPacketWriter
                        write.WriteString("04✖0104✖00  10 мОиʈɚʁ 1.0 ьєтд βע ғЭ';м4]и[u;Ҳ' 0401✖0004✖ ", True)

                        Conection.Send(write.ToAresPacket(10))

                      



                    End If
                    If aut.StartsWith("@viewtopic") Then
                        Dim write As New AresPacketWriter
                        write.WriteString(TextBox2.Text, True)
                        Conection.Send(write.ToAresPacket(10))
                    End If
                    If aut.StartsWith("@viewurl") Then
                        Dim write As New AresPacketWriter
                        write.WriteString(TextBox3.Text & " , " + TextBox7.Text, True)
                        Conection.Send(write.ToAresPacket(10))
                    End If
                    Try
                        If aut.StartsWith("@ropa 1") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(cvcl(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(0))), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If

                        If aut.StartsWith("@ropa 2") Then

                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(1)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If

                        If aut.StartsWith("@ropa 3") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(2)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 4") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(3)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 5") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(4)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 6") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(5)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 7") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(6)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 8") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(7)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 9") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(8)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 10") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(9)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 11") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(10)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 12") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(11)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 13") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(12)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 14") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(13)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 30") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(14)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 15") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(15)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 16") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(16)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 17") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(17)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 18") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(18)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 19") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(19)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 20") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(20)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 21") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(21)), True)
                            Conection.Send(write.ToAresPacket(10))

                        End If
                        If aut.StartsWith("@ropa 22") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(22)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 23") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(23)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 24") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(24)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 25") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(25)), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 26") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos(cvcl("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(26))), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 27") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(Convertformatos(cvcl("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(27))), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 28") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(cvcl(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(28))), True)
                            Conection.Send(write.ToAresPacket(10))


                        End If
                        If aut.StartsWith("@ropa 29") Then
                            Dim write As New AresPacketWriter
                            write.WriteString(cvcl(Convertformatos("#customname " + Label13.Text + user.Nombre + Label13.Text + " " + ListBox2.Items.Item(29))), True)
                            Conection.Send(write.ToAresPacket(10))
                        End If
                    Catch exception1 As Exception
                        Dim write As New AresPacketWriter
                        write.WriteString("0400✖0104✖00 10 ɘʀʀȍʁ ɛɴ ƈƌʁɕɑʀ ɚɭ ƇǖʂƬȍɱ: ǪȗȋʂƌՏ ՌՕ モヌエᄅナロ, ƲƷŔľƑľǬŨƸ... 0401✖0004✖")
                        Conection.Send(write.ToAresPacket(10))

                    End Try



                    If aut.StartsWith("@ayuda") Then
                        Dim write As New AresPacketWriter
                        Dim write2 As New AresPacketWriter
                        Dim write3 As New AresPacketWriter
                        Dim write4 As New AresPacketWriter
                        Dim write5 As New AresPacketWriter
                        Dim write6 As New AresPacketWriter
                        Dim write7 As New AresPacketWriter
                        Dim write8 As New AresPacketWriter
                        Dim write9 As New AresPacketWriter
                        Dim write10 As New AresPacketWriter
                        Dim write11 As New AresPacketWriter

                        write.WriteString("0400✖0104✖00 10 ------- сoмаиdө ------- 0401✖0004✖")
                        write2.WriteString(" ")
                        write3.WriteString("04✖0104✖00  10  @viewtopic ----> Para ver el topic de la sala 0401✖0004✖ ")
                        write4.WriteString("04✖0104✖00  10  @viewurl   ----> Para ver el Url De la sala 0401✖0004✖")
                        write5.WriteString("04✖0104✖00  10  @version   ----> La versión del Bot 0401✖0004✖ ")
                        write6.WriteString("04✖0104✖00  10  @ropa +n(1 a 30) ----> Para ponerse un custom 0401✖0004✖")
                        write7.WriteString("04✖0104✖00  10 Todos los comandos Son Públicos 0401✖0004✖  ")
                        write8.WriteString(" ")
                        write9.WriteString("0400✖0104✖00 10 ------- сoмаиdө ------- 0401✖0004✖ ")
                        write10.WriteString(" ")
                        write11.WriteString("04✖0104✖00  10 мОиʈɚʁ 1.0 ьєтд βy gUachOrro 0401✖0004✖ ")
                        Conection.Send(write.ToAresPacket(10))
                        Conection.Send(write2.ToAresPacket(10))
                        Conection.Send(write3.ToAresPacket(10))
                        Conection.Send(write4.ToAresPacket(10))
                        Conection.Send(write5.ToAresPacket(10))
                        Conection.Send(write6.ToAresPacket(10))
                        Conection.Send(write7.ToAresPacket(10))
                        Conection.Send(write8.ToAresPacket(10))
                        Conection.Send(write9.ToAresPacket(10))
                        Conection.Send(write10.ToAresPacket(10))
                        Conection.Send(write11.ToAresPacket(10))


                    End If
                    If aut.StartsWith("@roominfo") Then
                        info.RoomName = Datos.ReadString
                        Dim writer As New AresPacketWriter
                        writer.WriteString(info.RoomName)
                        Conection.Send(writer.ToAresPacket(10))

                    End If
                End If

            Case 44


                IndexText(Datos.ReadString)


            Case 0
                Try
                    Dim str As String = Datos.ReadString
                    If Conection.Connected Then
                        Conection.Disconnect(False)
                    End If
                    If (Not str.Length = 0) Then
                        Interaction.MsgBox("Desconectado:" & str, MsgBoxStyle.OkOnly, Nothing)
                    Else
                        'Desconectado(10057)
                    End If
                    Index = 0
                    Timer1.Enabled = True
                    enable = False
                    thread.Abort()
                Catch exception1 As Exception

                End Try
                Exit Select




            Case 13
                If Me.CheckBox1.Checked Then


                    If Not Me.CheckBox2.Checked Then
                        Dim str5 As String = Datos.ReadString
                        If (Datos.ReadString.StartsWith(ChrW(7)) AndAlso Conection.Connected) Then
                            Datos.PositionReaderAfterHeader()
                            Me.user.Nombre = Datos.ReadString
                            Datos.SkipByte()
                            Me.user.Mensaje_personal = Datos.ReadString
                            Dim writer2 As New AresPacketWriter
                            writer2.WriteString(Convertformatos(TextBox4.Text), True)
                            Conection.Send(writer2.ToAresPacket(10))
                        End If




                    End If


                    Dim str3 As String = Datos.ReadString
                    If (Datos.ReadString.StartsWith(ChrW(7)) AndAlso Conection.Connected) Then
                        Datos.PositionReaderAfterHeader()
                        user.Nombre = Datos.ReadString
                        Datos.SkipByte()
                        user.Mensaje_personal = Datos.ReadString



                        Dim writer1 As New AresPacketWriter
                        writer1.WriteString(Convertformatos(TextBox4.Text), True)
                        Conection.Send(writer1.ToAresPacket(11))


                    End If
                End If



            Case 20
                RTA2.Add(Datos.ReadBytes(2))
                user.Archivos = BitConverter.ToInt16(RTA2.ToArray, 0)
                Datos.SkipBytes(4)
                user.IpExternal = Datos.ReadIP
                RTA.Add(Datos.ReadBytes(2))
                user.DCport = BitConverter.ToInt16(RTA.ToArray, 0)
                Datos.SkipBytes(4)
                Datos.SkipBytes(2)
                Datos.SkipByte()
                user.Nombre = Datos.ReadString

                user.Comparte_Archivos = Datos.ReadBytes(1)
                user.Nivel = Datos.ReadByte
                If Datos.Remaining > 3 Then
                    Threading.Thread.Sleep(40)
                    user.Años = Datos.ReadByte
                    user.sexo = Datos.ReadByte
                    user.Pais = Datos.ReadByte
                    user.Cuidad = Datos.ReadString
                End If
                Usuariosenlasala.Add(user)
                Dim msg As String = "   " & user.Nombre & ", [" & user.IpExternal.ToString & "] compartiendo " & user.Archivos.ToString & " archivos, ha entrado a la sala"
                Dim users As String = user.Nombre
                listuser(users)
                IndexText(msg)

                If CheckBox3.Checked Then

                    Dim writer3 As New AresPacketWriter
                    writer3.WriteString(ConvertbienvenidaPV(TextBox1.Text), True)
                    Conection.Send(writer3.ToAresPacket(25))
                End If


                If Me.CheckBox4.Checked Then
                    Dim writer5 As New AresPacketWriter
                    writer5.WriteString(Convertbienvenida(TextBox5.Text), True)
                    Conection.Send(writer5.ToAresPacket(10))
                End If
                listuser(user.Nombre)
                Exit Select
            Case 22
                user.Nombre = Datos.ReadString
                IndexText(user.Nombre + " Ha Salido...")
                If CheckBox5.Checked Then

                    Dim writer As New AresPacketWriter
                    If Conection.Connected Then
                        writer.WriteString(Convertbienvenida(TextBox6.Text), True)
                        Conection.Send(writer.ToAresPacket(10))

                    End If

                End If
                Exit Select
            Case 11
                user.Nombre = Datos.ReadString
                user.Texto = Datos.ReadString
                IndexText("* " + user.nombre + " " + user.texto)
                Exit Select
            Case 73
                Url(Datos.ReadString)
                urltext(Datos.ReadString)
                Exit Select







        End Select
    End Sub
    Private Function Convertformatos(ByVal m As String) As String
        m = m.Replace("+n", user.Nombre).Replace("+m", user.Mensaje_personal).Replace(ChrW(2) & "3", ChrW(3)).Replace(ChrW(2) & "5", ChrW(5)).Replace(ChrW(2) & "6", ChrW(6)).Replace(ChrW(2) & "9", ChrW(9)).Replace(ChrW(2) & "7", ChrW(7)).Replace(ChrW(57346), ChrW(2))
        Return m.ToString
    End Function
    Private Function ConvertbienvenidaPV(ByVal m As String) As String
        m = m.Replace("+n", user.Nombre).Replace("+a", CInt(user.Comparte_Archivos)).Replace("+p", (CInt(Me.user.DCport))).Replace("+lvl", (Me.user.Nivel)).Replace("+l", Me.user.Cuidad).Replace("+e", (CInt(Me.user.Años)))
        Return m.ToString
    End Function
    Private Function Convertbienvenida(ByVal m As String) As String
        m = m.Replace("+n", user.Nombre).Replace("+a", CInt(user.Comparte_Archivos)).Replace("+p", (CInt(Me.user.DCport))).Replace("+lvl", (Me.user.Nivel)).Replace("+l", Me.user.Cuidad).Replace("+e", (CInt(Me.user.Años)))

        Return m.ToString
    End Function
  
  
    Function cvcl(ByVal Text As String) As String
        Text = Text.Replace("6", "").Replace("3", "").Replace("5", "").Replace("7", "")
        Return Text
    End Function
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Select Case Button1.Text

            Case "Start"
                thread = New Threading.Thread(AddressOf recivimiento)
                Conection = New Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
                Try
                    Conection.Connect(New IPEndPoint(IPAddress.Parse(ip.Text), CInt(port.Text)))

                Catch ex As Exception

                End Try
                If Conection.Connected Then
                    IndexText("Conectando porfavor espere...")
                    Conection.Send(protocolo)
                    enable = True
                    thread.Start()
                    Timer1.Enabled = True
                End If
                If Conection.Connected Then
                    Dim writer As New AresPacketWriter
                    writer.WriteString("b0t test")
                    Conection.Send(writer.ToAresPacket(13))
                End If
                Button1.Text = "Reconnect"
            Case "Reconnect"
                thread = New Threading.Thread(AddressOf recivimiento)
                Conection = New Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
                Try
                    Conection.Connect(New IPEndPoint(IPAddress.Parse(ip.Text), CInt(port.Text)))

                Catch ex As Exception

                End Try
                If Conection.Connected Then
                    IndexText("Conectando porfavor espere...")
                    Conection.Send(protocolo)
                    enable = True
                    thread.Start()
                    Timer1.Enabled = True
                End If
                If Conection.Connected Then
                    Dim writer As New AresPacketWriter
                    writer.WriteString("b0t test")
                    Conection.Send(writer.ToAresPacket(13))
                End If

        End Select

    End Sub
    Public Function protocolo() As Byte()
        Dim buffer As New List(Of Byte)
        buffer.Add(2)
        buffer.AddRange(Guid.NewGuid().ToByteArray())
        buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(666)))
        buffer.Add(0)
        buffer.AddRange(BitConverter.GetBytes(Convert.ToInt16(5000)))
        buffer.AddRange(New Byte() {0, 0, 0, 0}) '
        buffer.AddRange(New Byte() {0, 0})
        buffer.AddRange(New Byte() {0, 0, 0, 0})
        buffer.AddRange(Encoding.UTF8.GetBytes(nick.Text))
        buffer.Add(0)
        buffer.AddRange(Encoding.UTF8.GetBytes(" b0t test by guachorro"))
        buffer.Add(0)
        buffer.AddRange(IPAddress.Parse("127.1.0.0").GetAddressBytes())
        buffer.AddRange(IPAddress.Parse("6.6.6.6").GetAddressBytes())
        buffer.Add(0)
        buffer.Add(0)
        buffer.Add(0)
        buffer.Add(0)
        buffer.Add(CByte(73))
        buffer.Add(CByte(1))
        buffer.Add(CByte(9))
        buffer.AddRange(Encoding.UTF8.GetBytes("Córdoba"))
        buffer.Add(0)
        buffer.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(buffer.Count - 1)))
        Return buffer.ToArray()
    End Function

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Try
            thread.Abort()
            Timer1.Enabled = False
            Button1.Text = "Start"
            If Conection.Connected Then
                Conection.Disconnect(False)
            End If

        Catch ex As ExecutionEngineException

        End Try
End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim lit As New List(Of Byte)
        lit.Add(4)
        lit.AddRange(BitConverter.GetBytes(Convert.ToInt16(666)))
        lit.Add(1)
        lit.AddRange(New Byte() {0})
        lit.AddRange(New Byte() {0, 0, 0, 0})
        lit.AddRange(New Byte() {0, 0})
        lit.AddRange(IPAddress.Parse("127.1.0.0").GetAddressBytes())
        lit.Add(1)
        lit.Add(1)
        lit.Add(0)
        lit.Add(20)
        lit.Add(CByte(73))
        lit.Add(CByte(1))
        lit.Add(CByte(9))
        lit.AddRange(Encoding.UTF8.GetBytes("córdoba"))
        lit.Add(0)
        lit.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(lit.Count - 1)))
        If Conection.Connected Then
            Conection.Send(lit.ToArray)
        End If
        lit.Clear()
    End Sub


   





        With OpenFileDialog1
            .FileName = ""
            .Filter = "Archivos de texto *.txt|*.txt|Todos *.*|*.*"

            .ShowDialog()
 If .FileName <> "" Then
                Leer(.FileName)
            End If
        End With
    End Sub









    Private Sub TextBox9_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) Handles TextBox9.KeyPress
        If e.KeyChar = ChrW(13) Then
            e.Handled = True

            Dim Datos As New List(Of Byte)
            Datos.Add(10)
            Datos.AddRange(Encoding.UTF8.GetBytes(TextBox9.Text))
            Datos.InsertRange(0, BitConverter.GetBytes(Convert.ToInt16(CInt((Datos.Count - 1)))))
            If Conection.Connected Then
                Conection.Send(Datos.ToArray)
            End If
            TextBox9.Clear()
        End If






    End Sub


    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Try
            If DomainUpDown1.Text.StartsWith("ALL") Then
                ListBox2.Items.Clear()
            End If
            ListBox2.Items.RemoveAt(DomainUpDown1.Text)

        Catch ex As Exception
            MsgBox("Error No Hay Ropa " + DomainUpDown1.Text, MsgBoxStyle.Information)

        End Try

    End Sub


Private Sub TextBox10_TextChanged_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged



    End Sub

    Function Leer(ByVal path As String) As String
        Try
            Dim oSR As StreamReader = New StreamReader(path)
            Dim l As String
            Dim tempSTR As String = ""
            l = oSR.ReadLine()
            Dim asd As New AresPacketWriter
            asd.WriteString(cvcl(l), True)
            Conection.Send(asd.ToAresPacket(10))
            While Not l Is Nothing
                tempSTR = tempSTR & l & vbNewLine
                l = oSR.ReadLine()
                Dim e As New AresPacketWriter
                e.WriteString(cvcl(l), True)
                Conection.Send(e.ToAresPacket(10))
            End While
            oSR.Close()
            oSR.Dispose()
            Return tempSTR
        Catch oe As Exception
            Return ""
            MsgBox(oe.Message)
        End Try
    End Function
End Class

Esté Codigo Fuente, No esta Completo :D se los dejo de tarea,  Si no entienden algo del codigo
agregen este msn guachorro@hotmail.com.ar , y les ayudo y les explico.

X1, Ignsiguia que representa a una Sociedad Unidad para Aprender y enseñar
esta sociedad esta Comenzando en el Ares;
Cuálquiera que quiera entrar a esta sociedad se pone su ignsiguia, porque todo aquel que ayuda y enseña en el ares, lo tomamos como Socio (Y).


Saludos X;ĝŨacћoѓѓӨ;X1




1 comentarios:

Anónimo dijo...

MEJOR ES PONER LA COMPILACION DEL PROGRAMA =D ASII VA A SER MEJOR CONTESTA LA PREGUNTA :O VAMOS ARGENTINA (H)