elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Temas
Páginas: [1]
1  Programación / Programación General / Fallo en la SWF que permite usar CE en: 21 Enero 2020, 16:01 pm
Tengo una pregunta sobre Flash, ya que esta un poco desactualizado y hay que pasarlo a HTML5, pero de mientras me gustaria saber si me dan una respuesta valida, ya que en el juego mucha gente usa el CE modificando la swf y me gustaria saber como puedo hacer para que esto deje de suceder gracias.
2  Programación / .NET (C#, VB.NET, ASP) / Denegación por el host remoto ERROR en: 10 Febrero 2017, 14:34 pm
Estoy en un proyecto asociado con Senior++ bastante veterano en el foro y nos ha surgido un problema en la creación de un Script para www.boombang.nl.
El caso es que ya después de tenerlo todo ya hecho me da un error y me gustaría saber si me podrían ayudar, el error que me salta dice algo a si: Denegación por el host remoto
Lo que intento hacer es que desde el Script haga las acciones que yo diga es decir que envíe packets y estos se ejecuten desde el programa me gustaría saber por que me da error el codigo es el siguiente

Class.cs
Llamada Conexion1.cs

Código
  1. using System;
  2. using System.Drawing;
  3. using System.Net.Sockets;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. using System.Threading;
  7. using Script_Client_BB;
  8.  
  9. namespace Script_Client_BB
  10. {
  11.   internal class Conexion1
  12.    {
  13.        public static TcpClient client;
  14.        public static TcpClient server;
  15.        public static TcpListener listener;
  16.        public static NetworkStream ServerStream;
  17.        public static NetworkStream ClientStream;
  18.        public static Form1 abc;
  19.        public Conexion1(Form1 abcd)
  20.        {
  21.            Conexion1.abc = abcd;
  22.        }
  23.        public static void ConectarConBoomBang()
  24.        {
  25.            Politica.ExchangePolicies(ref Conexion1.listener, ref Conexion1.client, ref Conexion1.server);
  26.            Conexion1.client = Conexion1.listener.AcceptTcpClient();
  27.            Conexion1.ClientStream = Conexion1.client.GetStream();
  28.            Conexion1.ServerStream = Conexion1.server.GetStream();
  29.            Conexion1.abc.label4.Text = "Conectado";
  30.            Conexion1.abc.label4.ForeColor = Color.Lime;
  31.  
  32.  
  33.            Util1.UseButtons = true;
  34.            while (Conexion1.server.Connected && Conexion1.client.Connected)
  35.            {
  36.                if (Conexion1.client.Available > 0)
  37.                {
  38.                    byte[] array = new byte[Conexion1.client.Available];
  39.                    Conexion1.ClientStream.Read(array, 0, Conexion1.client.Available);
  40.                    byte[] array2 = Encriptacion.Deciphe(array);
  41.                    string @string = Encoding.Default.GetString(array2);
  42.                    string[] array3 = Regex.Split(@string, "\0xB3B2");
  43.                    if (!@string.Contains("\0xB1"))
  44.                    {
  45.                        if (Util1.ActivarS)
  46.                        {
  47.                            Util1.EscucharServidor(array2);
  48.                        }
  49.                        Util1.Servidor(@string);
  50.                    }
  51.                    else
  52.                    {
  53.                        string[] array4 = Regex.Split(@string, "\0xB1");
  54.                        int num = array4.Length - 1;
  55.                        for (int i = 1; i <= num; i++)
  56.                        {
  57.                            string text = "\0xB1" + array4;
  58.                            byte[] bytes = Encoding.Default.GetBytes(text);
  59.                            Util1.Servidor(text);
  60.                            Util1.EscucharServidor(bytes);
  61.                        }
  62.                    }
  63.                }
  64.                if (Conexion1.server.Available > 0)
  65.                {
  66.                    byte[] array5 = new byte[Conexion1.server.Available];
  67.                    Conexion1.ServerStream.Read(array5, 0, Conexion1.server.Available);
  68.                    byte[] array2 = Encriptacion.Enciphe(array5, 135);
  69.                    string @string = Encoding.Default.GetString(array2);
  70.                    string[] array3 = Regex.Split(@string, "\0xB3B2");
  71.                    if (!@string.Contains("\0xB1"))
  72.                    {
  73.                        if (Util1.ActivarC)
  74.                        {
  75.                            Util1.EscucharCliente(array2);
  76.                        }
  77.                        Util1.Cliente(@string);
  78.                    }
  79.                    else
  80.                    {
  81.                        string[] array4 = Regex.Split(@string, "\0xB1");
  82.                        int num = array4.Length - 1;
  83.                        for (int i = 1; i <= num; i++)
  84.                        {
  85.                            string text2 = "\0xB1" + array4;
  86.                            byte[] bytes = Encoding.Default.GetBytes(text2);
  87.                            Util1.Cliente(text2);
  88.                            Util1.EscucharCliente(bytes);
  89.                        }
  90.                    }
  91.  
  92.                }
  93.  
  94.            }
  95.        }
  96.  
  97.    }
  98. }
  99.  
Class.cs llamada:
Kids.cs
Código
  1. Kids.cs
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using Fiddler;
  8.  
  9. namespace Script_Client_BB
  10. {
  11.    internal class Kids
  12.    {//www.//bomfrank1un.esy.es
  13.        public static void FiddlerApplicationStart()
  14.        {
  15.            FiddlerApplication.Startup(8877, true, true);
  16.            FiddlerApplication.BeforeRequest += delegate(Session session)
  17.            {
  18.                if (session.uriContains("BoomBangKids.swf"))
  19.                {
  20.                    session.fullUrl = "http://bomfrank1un.esy.es/BBKids.swf";//Direcion de la BBKid
  21.                }
  22.            };
  23.            FiddlerApplication.AfterSessionComplete += delegate(Session sesion)
  24.            {
  25.                if (sesion.uriContains("Kids.swf"))
  26.                {
  27.                    FiddlerApplication.Shutdown();
  28.                }
  29.            };
  30.        }
  31.    }
  32. }
  33.  
Class.cs llamada:
Encriptacion.cs

Código
  1. using System;
  2.  
  3.  
  4. namespace Script_Client_BB
  5. {
  6.   internal class Encriptacion
  7.    {
  8.        private static int c1 = 135;
  9.        private static int c2 = 135;
  10.        private static int c3 = 135;
  11.        private static int c4 = 135;
  12.        private static int m1 = 0;
  13.        private static int m2 = 0;
  14.        private static int m3 = 0;
  15.        private static int m4 = 0;
  16.        private static int Rand(int RandN)
  17.        {
  18.            return 1103515245 * RandN + 12344;
  19.        }
  20.        public static byte[] Enciphe(byte[] byte_0, int Numero)
  21.        {
  22.            int num = byte_0.Length;
  23.            byte[] array = new byte[num];
  24.            int num2 = 0;
  25.            while (num-- > 0)
  26.            {
  27.                int num3 = (int)byte_0[num2];
  28.                int num4 = num3 ^ Encriptacion.c1 ^ m1;
  29.                array[num2] = (byte)num4;
  30.                num2++;
  31.                Encriptacion.c1 = Encriptacion.Rand(Encriptacion.c1);
  32.                Encriptacion.m1 = num4;
  33.            }
  34.            return array;
  35.        }
  36.        public static byte[] Deciphe(byte[] byte_0)
  37.        {
  38.            int num = byte_0.Length;
  39.            byte[] array = new byte[num];
  40.            int num2 = 0;
  41.            while (num-- > 0)
  42.            {
  43.                int num3 = (int)byte_0[num2];
  44.                int num4 = num3 ^ Encriptacion.c2 ^ m2;
  45.                array[num2] = (byte)num4;
  46.                num2++;
  47.                Encriptacion.c2 = Encriptacion.Rand(Encriptacion.c2);
  48.                Encriptacion.m2 = num4;
  49.            }
  50.            return array;
  51.        }
  52.        public static byte[] Encrypt(byte[] byte_0)
  53.        {
  54.            int num = byte_0.Length;
  55.            byte[] array = new byte[num];
  56.            int num2 = 0;
  57.            while (num-- > 0)
  58.            {
  59.                int num3 = (int)byte_0[num2];
  60.                int num4 = num3 ^ Encriptacion.c3 ^ m3;
  61.                array[num2] = (byte)num4;
  62.                num2++;
  63.                Encriptacion.c3 = Encriptacion.Rand(Encriptacion.c3);
  64.                Encriptacion.m3 = num3;
  65.            }
  66.            return array;
  67.        }
  68.        public static byte[] Encrypt2(byte[] byte_0)
  69.        {
  70.            int num = byte_0.Length;
  71.            byte[] array = new byte[num];
  72.            int num2 = 0;
  73.            while (num-- > 0)
  74.            {
  75.                int num3 = (int)byte_0[num2];
  76.                int num4 = num3 ^ Encriptacion.c4 ^ m4;
  77.                array[num2] = (byte)num4;
  78.                num2++;
  79.                Encriptacion.c4 = Encriptacion.Rand(Encriptacion.c4);
  80.                Encriptacion.m4 = num3;
  81.            }
  82.            return array;
  83.        }
  84.        public static byte[] Encryptation(byte[] byte_0)
  85.        {
  86.            int num = byte_0.Length;
  87.            byte[] array = new byte[num];
  88.            int num2 = 0;
  89.            while (num-- > 0)
  90.            {
  91.                int num3 = (int)byte_0[num2];
  92.                int num4 = num3 ^ Encriptacion.c3 ^ m3;
  93.                array[num2] = (byte)num4;
  94.                num2++;
  95.                Encriptacion.c3 = Encriptacion.Rand(Encriptacion.c3);
  96.                Encriptacion.m3 = num3;
  97.            }
  98.            return array;
  99.        }
  100.        public static byte[] Dencryptaction(byte[] byte_0)
  101.        {
  102.            int num = byte_0.Length;
  103.            byte[] array = new byte[num];
  104.            int num2 = 0;
  105.            while (num-- > 0)
  106.            {
  107.                int num3 = (int)byte_0[num2];
  108.                int num4 = num3 ^ Encriptacion.c2 ^ m2;
  109.                array[num2] = (byte)num4;
  110.                num2++;
  111.                Encriptacion.c2 = Encriptacion.Rand(Encriptacion.c2);
  112.                Encriptacion.m2 = num4;
  113.            }
  114.            return array;
  115.        }
  116.    }
  117. }
  118.  

Class.cs llamada:
Politica.cs
Código
  1. using System;
  2. using System.Net;
  3. using System.Net.Sockets;
  4. using System.Threading;
  5.  
  6. namespace Script_Client_BB
  7. {
  8.   internal class Politica
  9.   {
  10.        public static void ExchangePolicies(ref TcpListener listener, ref TcpClient client, ref TcpClient server)
  11.        {
  12.            listener = new TcpListener(IPAddress.Any, 6923);//Puerto
  13.            listener.Start();//www.bomfrank1un.esy.es
  14.            client = listener.AcceptTcpClient();
  15.            server = new TcpClient("188.165.61.115", 6923);//IP - Puerto
  16.            while (client.Available < 1)
  17.            {
  18.                Thread.Sleep(10);
  19.            }
  20.            byte[] array = new byte[client.Available];
  21.            client.GetStream().Read(array, 0, client.Available);
  22.            server.GetStream().Write(array, 0, array.Length);
  23.            server.GetStream().Flush();
  24.            while (server.Available < 1)
  25.            {
  26.                Thread.Sleep(10);
  27.            }
  28.            array = new byte[server.Available];
  29.            server.GetStream().Read(array, 0, server.Available);
  30.            server.Close();
  31.            server = new TcpClient("188.165.61.115", 6923);//IP - Puerto
  32.            client.GetStream().Write(array, 0, array.Length);
  33.            client.GetStream().Flush();
  34.            client.Close();
  35.        }
  36.    }
  37. }
  38.  

Class.cs Llamada:
Util1.cs
Código
  1. using System;
  2. using System.Text;
  3. using System.Text.RegularExpressions;
  4. using System.Windows.Forms;
  5. using Script_Client_BB;
  6.  
  7. namespace Script_Client_BB
  8. {
  9.   internal class Util1
  10.    {
  11.  
  12.        public static bool UseButtons = false;
  13.        public static byte[] Server;
  14.        public static byte[] Client;
  15.        public static PacketLogger abc;
  16.  
  17.        public static bool ActivarS = false;
  18.        public static bool ActivarC = false;
  19.        private PacketLogger packetLogger;
  20.        private Form1 form1;
  21.        public static string Hora
  22.        {
  23.            get
  24.            {
  25.                return "[" + DateTime.Now.ToString("hh:mm:ss") + "] ";
  26.            }
  27.        }
  28.        public Util1(PacketLogger abcd)
  29.        {
  30.            Util1.abc = abcd;
  31.        }
  32.  
  33.        public Util1()
  34.        {
  35.            // TODO: Complete member initialization
  36.        }
  37.  
  38.  
  39.  
  40.        public Util1(Form1 form1)
  41.        {
  42.            // TODO: Complete member initialization
  43.            this.form1 = form1;
  44.        }
  45.        public static void EscucharCliente(byte[] byte_0)
  46.        {
  47.            byte b = byte_0[1];
  48.            int num = (int)((byte_0[3] == 178) ? 0 : byte_0[3]);
  49.            string @string = Encoding.Default.GetString(byte_0);
  50.            if (Util1.ActivarC)
  51.            {
  52.                Util1.abc.richTextBox1.Text = string.Concat(new object[]
  53.            {
  54.               Util1.abc.richTextBox1.Text,
  55.               "[",
  56.               b,
  57.               "/",
  58.               num,
  59.               "] Cliente: ",
  60.               @string,
  61.                    Environment.NewLine
  62.            });
  63.            }
  64.        }
  65.        public static void EscucharServidor(byte[] byte_0)
  66.        {
  67.  
  68.            byte id = byte_0[1];
  69.            byte type = byte_0[2];
  70.  
  71.            int num = (int)((byte_0[2] == 178) ? 178 : byte_0[3]);
  72.            string @string = Encoding.Default.GetString(byte_0);
  73.            if (Util1.ActivarS)
  74.            {
  75.                Util1.abc.richTextBox1.Text = string.Concat(new object[]
  76.            {
  77.               Util1.abc.richTextBox1.Text,
  78.               "[",
  79.               id,
  80.               "/",
  81.               num,
  82.               "] Servidor: ",
  83.               @string,
  84.                    Environment.NewLine
  85.            });
  86.            }
  87.            if (id == 186 && type == 178)
  88.            {
  89.                ////   [186/178] Paquete-> ±º³²1³²d³²2³²°
  90.                string[] dividir = Regex.Split(@string, "³²");
  91.                string cmd = dividir[2];
  92.                if (cmd.StartsWith("@"))
  93.                {
  94.                    cmd = cmd.Replace("@", "").ToLower();
  95.                    Comandos(cmd);
  96.                }
  97.            }
  98.        }
  99.  
  100.        private static void Comandos(string cmd)
  101.        {
  102.  
  103.            switch (cmd)
  104.            {
  105.                case "packetlogger":
  106.                    Util1.Servidor("±†³²0³²3³²°");
  107.  
  108.                    break;
  109.            }
  110.        }
  111.  
  112.        public static void Servidor(string str)
  113.        {
  114.            Util1.Server = Encoding.Default.GetBytes(str);
  115.            Util1.Server = Encriptacion.Encrypt(Util1.Server);
  116.            Conexion1.ServerStream.Write(Util1.Server, 0, Util1.Server.Length);
  117.            Conexion1.ServerStream.Flush();
  118.        }
  119.        public static object ComposeSpam(string str)
  120.        {
  121.            return string.Concat(new object[]
  122.         {
  123.            str,
  124.            " [",
  125.            new Random().Next(109000, 67534653),
  126.            "]"
  127.         });
  128.        }
  129.        public static void Cliente(string str)
  130.        {
  131.            Util1.Client = Encoding.Default.GetBytes(str);
  132.            Util1.Client = Encriptacion.Encrypt2(Util1.Client);
  133.            Conexion1.ClientStream.Write(Util1.Client, 0, Util1.Client.Length);
  134.            Conexion1.ClientStream.Flush();
  135.        }
  136.        public static void SendUppercut()
  137.        {
  138.            int[] array = new int[]
  139.         {
  140.            431721,
  141.            431721,
  142.            431721
  143.         };
  144.            Random[] array2 = new Random[new Random().Next(array[1], array[2])];
  145.        }
  146.        public static string Send_Uppercuts(string str)
  147.        {
  148.            switch (str)
  149.            {
  150.                case "0":
  151.                    Util1.Servidor("±‘³²0³²°");
  152.                    break;
  153.                case "1":
  154.                    Util1.Servidor("±‘³²1³²°");
  155.                    break;
  156.                case "2":
  157.                    Util1.Servidor("±‘³²2³²°");
  158.                    break;
  159.                case "3":
  160.                    Util1.Servidor("±‘³²3³²°");
  161.                    break;
  162.                case "4":
  163.                    Util1.Servidor("±‘³²4³²°");
  164.                    break;
  165.                case "5":
  166.                    Util1.Servidor("±‘³²5³²°");
  167.                    break;
  168.                case "6":
  169.                    Util1.Servidor("±‘³²6³²°");
  170.                    break;
  171.                case "7":
  172.                    Util1.Servidor("±‘³²7³²°");
  173.                    break;
  174.                case "8":
  175.                    Util1.Servidor("±‘³²8³²°");
  176.                    break;
  177.                case "9":
  178.                    Util1.Servidor("±‘³²9³²°");
  179.                    break;
  180.                case "10":
  181.                    Util1.Servidor("±‘³²10³²°");
  182.                    break;
  183.                case "11":
  184.                    Util1.Servidor("±‘³²11³²°");
  185.                    break;
  186.            }
  187.            return str;
  188.        }
  189.  
  190.        public static string Color(string str)
  191.        {
  192.            string text = str;
  193.            if (text != null)
  194.            {
  195.                if (!(text == "1"))
  196.                {
  197.                    if (!(text == "2"))
  198.                    {
  199.                        if (text == "3")
  200.                        {
  201.                            str = "11";
  202.                        }
  203.                    }
  204.                    else
  205.                    {
  206.                        str = "6";
  207.                    }
  208.                }
  209.                else
  210.                {
  211.                    str = "3";
  212.                }
  213.            }
  214.            return str;
  215.        }
  216.    }
  217. }
  218.  
Class.cs llamada:
Bucles.cs
Código
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.RegularExpressions;
  4. using System.Windows.Forms;
  5.  
  6. namespace Script_Client_BB
  7. {
  8.   internal class Bucles
  9.    {
  10.        public static bool RepetirText = false;
  11.        public static bool CathItemWalk = false;
  12.        public static bool CopiarLook = false;
  13.        public static bool Login = true;
  14.        public static bool Teleport = false;
  15.        public static string str_texto = string.Empty;
  16.        public static List<string> DatoUsuario = new List<string>();
  17.        private static string password;
  18.        public static void ServerBucle(string str)
  19.        {
  20.            string[] array = Regex.Split(str, "³²");
  21.            if (str.Contains("±x³y"))
  22.            {
  23.                Bucles.password = array[2];
  24.            }
  25.        }
  26.        public static void ClientBucles(string str, RichTextBox richtextbox)
  27.        {
  28.            string[] array = Regex.Split(str, "³²");
  29.            if (Bucles.Login)
  30.            {
  31.                if (str.Contains("±x³y"))
  32.                {
  33.                    Bucles.DatoUsuario.Add(string.Concat(new string[]
  34.               {
  35.                  "Nombre Keko: ",
  36.                  array[2],
  37.                  Environment.NewLine,
  38.                  "Contraseña: ",
  39.                  Bucles.password,
  40.                  Environment.NewLine,
  41.                  "Email: ",
  42.                  array[5],
  43.                  Environment.NewLine,
  44.                  "ID: ",
  45.                  array[10]
  46.               }));
  47.                }
  48.            }
  49.            if (Bucles.Teleport)
  50.            {
  51.                if (str.Contains("±º"))
  52.                {
  53.  
  54.                }
  55.            }
  56.        }
  57.    }
  58. }
  59.  

Esta es la parte en la que me da error lo que quiero hacer es que de Upper a todo el mundo sin tener que fichar o teniendo la ficha de otro siga dando upper a cualquiera, y que envíe packets pero no de forma tan bestia ya que el juego bloquea al detectar muchos clicks, solo necesito saber cual es el error de esta parte
Si alguien me pudiera ayudar seria fantástico gracias por su tiempo.

Código
  1. public static void SendUppercut()
  2.        {
  3.            int[] array = new int[]
  4.         {
  5.            431721,
  6.            431721,
  7.            431721
  8.         };
  9.            Random[] array2 = new Random[new Random().Next(array[1], array[2])];
  10.        }
  11.        public static string Send_Uppercuts(string str)
  12.        {
  13.            switch (str)
  14.            {
  15.                case "0":
  16.                    Util1.Servidor("±‘³²0³²°");
  17.                    break;
  18.                case "1":
  19.                    Util1.Servidor("±‘³²1³²°");
  20.                    break;
  21.                case "2":
  22.                    Util1.Servidor("±‘³²2³²°");
  23.                    break;
  24.                case "3":
  25.                    Util1.Servidor("±‘³²3³²°");
  26.                    break;
  27.                case "4":
  28.                    Util1.Servidor("±‘³²4³²°");
  29.                    break;
  30.                case "5":
  31.                    Util1.Servidor("±‘³²5³²°");
  32.                    break;
  33.                case "6":
  34.                    Util1.Servidor("±‘³²6³²°");
  35.                    break;
  36.                case "7":
  37.                    Util1.Servidor("±‘³²7³²°");
  38.                    break;
  39.                case "8":
  40.                    Util1.Servidor("±‘³²8³²°");
  41.                    break;
  42.                case "9":
  43.                    Util1.Servidor("±‘³²9³²°");
  44.                    break;
  45.                case "10":
  46.                    Util1.Servidor("±‘³²10³²°");
  47.                    break;
  48.                case "11":
  49.                    Util1.Servidor("±‘³²11³²°");
  50.                    break;
  51.            }
  52.            return str;
  53.        }
  54.  

3  Programación / Programación C/C++ / Ayuda sobre una creacion de un "Script" en: 9 Febrero 2017, 10:04 am
Llevo ya un tiempo jugando a un juego llamado BoomBang y hace unos días me adentré a crear un script para dicho juego, el problema es que después de tenerlo ya todo no se como hacer para que envíe los packets al servidor( Las acciones que yo quiera que haga el keko )

Conexion1.cs
Código
  1.  
using System;
using System.Drawing;
using System.Net.Sockets;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Script_Client_BB;

namespace Script_Client_BB
{
   internal class Conexion1
    {
        public static TcpClient client;
        public static TcpClient server;
        public static TcpListener listener;
        public static NetworkStream ServerStream;
        public static NetworkStream ClientStream;
        public static Form1 abc;
        public Conexion1(Form1 abcd)
        {
            Conexion1.abc = abcd;
        }
        public static void ConectarConBoomBang()
        {
            Politica.ExchangePolicies(ref Conexion1.listener, ref Conexion1.client, ref Conexion1.server);
            Conexion1.client = Conexion1.listener.AcceptTcpClient();
            Conexion1.ClientStream = Conexion1.client.GetStream();
            Conexion1.ServerStream = Conexion1.server.GetStream();
            Conexion1.abc.label4.Text = "Conectado";
            Conexion1.abc.label4.ForeColor = Color.Lime;


            Util1.UseButtons = true;
            while (Conexion1.server.Connected && Conexion1.client.Connected)
            {
                if (Conexion1.client.Available > 0)
                {
                    byte[] array = new byte[Conexion1.client.Available];
                    Conexion1.ClientStream.Read(array, 0, Conexion1.client.Available);
                    byte[] array2 = Encriptacion.Deciphe(array);
                    string @string = Encoding.Default.GetString(array2);
                    string[] array3 = Regex.Split(@string, "\0xB3B2");
                    if (!@string.Contains("\0xB1"))
                    {
                        if (Util1.ActivarS)
                        {
                            Util1.EscucharServidor(array2);
                        }
                        Util1.Servidor(@string);
                    }
                    else
                    {
                        string[] array4 = Regex.Split(@string, "\0xB1");
                        int num = array4.Length - 1;
                        for (int i = 1; i <= num; i++)
                        {
                            string text = "\0xB1" + array4;
                            byte[] bytes = Encoding.Default.GetBytes(text);
                            Util1.Servidor(text);
                            Util1.EscucharServidor(bytes);
                        }
                    }
                }
                if (Conexion1.server.Available > 0)
                {
                    byte[] array5 = new byte[Conexion1.server.Available];
                    Conexion1.ServerStream.Read(array5, 0, Conexion1.server.Available);
                    byte[] array2 = Encriptacion.Enciphe(array5, 135);
                    string @string = Encoding.Default.GetString(array2);
                    string[] array3 = Regex.Split(@string, "\0xB3B2");
                    if (!@string.Contains("\0xB1"))
                    {
                        if (Util1.ActivarC)
                        {
                            Util1.EscucharCliente(array2);
                        }
                        Util1.Cliente(@string);
                    }
                    else
                    {
                        string[] array4 = Regex.Split(@string, "\0xB1");
                        int num = array4.Length - 1;
                        for (int i = 1; i <= num; i++)
                        {
                            string text2 = "\0xB1" + array4;
                            byte[] bytes = Encoding.Default.GetBytes(text2);
                            Util1.Cliente(text2);
                            Util1.EscucharCliente(bytes);
                        }
                    }

                }

            }
        }

    }
}

Kids.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Fiddler;

namespace Script_Client_BB
{
    internal class Kids
    {//www.//bomfrank1un.esy.es
        public static void FiddlerApplicationStart()
        {
            FiddlerApplication.Startup(8877, true, true);
            FiddlerApplication.BeforeRequest += delegate(Session session)
            {
                if (session.uriContains("BoomBangKids.swf"))
                {
                    session.fullUrl = "http://bomfrank1un.esy.es/BBKids.swf";//Direcion de la BBKid
                }
            };
            FiddlerApplication.AfterSessionComplete += delegate(Session sesion)
            {
                if (sesion.uriContains("Kids.swf"))
                {
                    FiddlerApplication.Shutdown();
                }
            };
        }
    }
}

Encriptacion.cs

using System;


namespace Script_Client_BB
{
   internal class Encriptacion
    {
        private static int c1 = 135;
        private static int c2 = 135;
        private static int c3 = 135;
        private static int c4 = 135;
        private static int m1 = 0;
        private static int m2 = 0;
        private static int m3 = 0;
        private static int m4 = 0;
        private static int Rand(int RandN)
        {
            return 1103515245 * RandN + 12344;
        }
        public static byte[] Enciphe(byte[] byte_0, int Numero)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c1 ^ m1;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c1 = Encriptacion.Rand(Encriptacion.c1);
                Encriptacion.m1 = num4;
            }
            return array;
        }
        public static byte[] Deciphe(byte[] byte_0)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c2 ^ m2;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c2 = Encriptacion.Rand(Encriptacion.c2);
                Encriptacion.m2 = num4;
            }
            return array;
        }
        public static byte[] Encrypt(byte[] byte_0)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c3 ^ m3;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c3 = Encriptacion.Rand(Encriptacion.c3);
                Encriptacion.m3 = num3;
            }
            return array;
        }
        public static byte[] Encrypt2(byte[] byte_0)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c4 ^ m4;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c4 = Encriptacion.Rand(Encriptacion.c4);
                Encriptacion.m4 = num3;
            }
            return array;
        }
        public static byte[] Encryptation(byte[] byte_0)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c3 ^ m3;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c3 = Encriptacion.Rand(Encriptacion.c3);
                Encriptacion.m3 = num3;
            }
            return array;
        }
        public static byte[] Dencryptaction(byte[] byte_0)
        {
            int num = byte_0.Length;
            byte[] array = new byte[num];
            int num2 = 0;
            while (num-- > 0)
            {
                int num3 = (int)byte_0[num2];
                int num4 = num3 ^ Encriptacion.c2 ^ m2;
                array[num2] = (byte)num4;
                num2++;
                Encriptacion.c2 = Encriptacion.Rand(Encriptacion.c2);
                Encriptacion.m2 = num4;
            }
            return array;
        }
    }
}

Politica.cs
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace Script_Client_BB
{
   internal class Politica
   {
        public static void ExchangePolicies(ref TcpListener listener, ref TcpClient client, ref TcpClient server)
        {
            listener = new TcpListener(IPAddress.Any, 6923);//Puerto
            listener.Start();//www.BoomMod.esy.es /SoftGames
            client = listener.AcceptTcpClient();
            server = new TcpClient("188.165.61.115", 6923);//IP - Puerto
            while (client.Available < 1)
            {
                Thread.Sleep(10);
            }
            byte[] array = new byte[client.Available];
            client.GetStream().Read(array, 0, client.Available);
            server.GetStream().Write(array, 0, array.Length);
            server.GetStream().Flush();
            while (server.Available < 1)
            {
                Thread.Sleep(10);
            }
            array = new byte[server.Available];
            server.GetStream().Read(array, 0, server.Available);
            server.Close();
            server = new TcpClient("188.165.61.115", 6923);//IP - Puerto
            client.GetStream().Write(array, 0, array.Length);
            client.GetStream().Flush();
            client.Close();
        }
    }
}

Util1.cs

using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Script_Client_BB;

namespace Script_Client_BB
{
   internal class Util1
    {

        public static bool UseButtons = false;
        public static byte[] Server;
        public static byte[] Client;
        public static PacketLogger abc;

        public static bool ActivarS = false;
        public static bool ActivarC = false;
        private PacketLogger packetLogger;
        private Form1 form1;
        public static string Hora
        {
            get
            {
                return "[" + DateTime.Now.ToString("hh:mm:ss") + "] ";
            }
        }
        public Util1(PacketLogger abcd)
        {
            Util1.abc = abcd;
        }

        public Util1()
        {
            // TODO: Complete member initialization
        }



        public Util1(Form1 form1)
        {
            // TODO: Complete member initialization
            this.form1 = form1;
        }
        public static void EscucharCliente(byte[] byte_0)
        {
            byte b = byte_0[1];
            int num = (int)((byte_0[3] == 178) ? 0 : byte_0[3]);
            string @string = Encoding.Default.GetString(byte_0);
            if (Util1.ActivarC)
            {
                Util1.abc.richTextBox1.Text = string.Concat(new object[]
            {
               Util1.abc.richTextBox1.Text,
               "[",
               b,
               "/",
               num,
               "] Cliente: ",
               @string,
                    Environment.NewLine
            });
            }
        }
        public static void EscucharServidor(byte[] byte_0)
        {

            byte id = byte_0[1];
            byte type = byte_0[2];

            int num = (int)((byte_0[2] == 178) ? 178 : byte_0[3]);
            string @string = Encoding.Default.GetString(byte_0);
            if (Util1.ActivarS)
            {
                Util1.abc.richTextBox1.Text = string.Concat(new object[]
            {
               Util1.abc.richTextBox1.Text,
               "[",
               id,
               "/",
               num,
               "] Servidor: ",
               @string,
                    Environment.NewLine
            });
            }
            if (id == 186 && type == 178)
            {
                ////   [186/178] Paquete-> ±º³²1³²d³²2³²°
                string[] dividir = Regex.Split(@string, "³²");
                string cmd = dividir[2];
                if (cmd.StartsWith("@"))
                {
                    cmd = cmd.Replace("@", "").ToLower();
                    Comandos(cmd);
                }
            }
        }

        private static void Comandos(string cmd)
        {

            switch (cmd)
            {
                case "packetlogger":
                    Util1.Servidor("±†³²0³²3³²°");

                    break;
            }
        }

        public static void Servidor(string str)
        {
            Util1.Server = Encoding.Default.GetBytes(str);
            Util1.Server = Encriptacion.Encrypt(Util1.Server);
            Conexion1.ServerStream.Write(Util1.Server, 0, Util1.Server.Length);
            Conexion1.ServerStream.Flush();
        }
        public static object ComposeSpam(string str)
        {
            return string.Concat(new object[]
         {
            str,
            " [",
            new Random().Next(109000, 67534653),
            "]"
         });
        }
        public static void Cliente(string str)
        {
            Util1.Client = Encoding.Default.GetBytes(str);
            Util1.Client = Encriptacion.Encrypt2(Util1.Client);
            Conexion1.ClientStream.Write(Util1.Client, 0, Util1.Client.Length);
            Conexion1.ClientStream.Flush();
        }
        public static void SendUppercut()
        {
            int[] array = new int[]
         {
            431721,
            431721,
            431721
         };
            Random[] array2 = new Random[new Random().Next(array[1], array[2])];
        }
        public static string Send_Uppercuts(string str)
        {
            switch (str)
            {
                case "0":
                    Util1.Servidor("±‘³²0³²°");
                    break;
                case "1":
                    Util1.Servidor("±‘³²1³²°");
                    break;
                case "2":
                    Util1.Servidor("±‘³²2³²°");
                    break;
                case "3":
                    Util1.Servidor("±‘³²3³²°");
                    break;
                case "4":
                    Util1.Servidor("±‘³²4³²°");
                    break;
                case "5":
                    Util1.Servidor("±‘³²5³²°");
                    break;
                case "6":
                    Util1.Servidor("±‘³²6³²°");
                    break;
                case "7":
                    Util1.Servidor("±‘³²7³²°");
                    break;
                case "8":
                    Util1.Servidor("±‘³²8³²°");
                    break;
                case "9":
                    Util1.Servidor("±‘³²9³²°");
                    break;
                case "10":
                    Util1.Servidor("±‘³²10³²°");
                    break;
                case "11":
                    Util1.Servidor("±‘³²11³²°");
                    break;
            }
            return str;
        }

        public static string Color(string str)
        {
            string text = str;
            if (text != null)
            {
                if (!(text == "1"))
                {
                    if (!(text == "2"))
                    {
                        if (text == "3")
                        {
                            str = "11";
                        }
                    }
                    else
                    {
                        str = "6";
                    }
                }
                else
                {
                    str = "3";
                }
            }
            return str;
        }
    }
}

Bucles.cs

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace Script_Client_BB
{
   internal class Bucles
    {
        public static bool RepetirText = false;
        public static bool CathItemWalk = false;
        public static bool CopiarLook = false;
        public static bool Login = true;
        public static bool Teleport = false;
        public static string str_texto = string.Empty;
        public static List<string> DatoUsuario = new List<string>();
        private static string password;
        public static void ServerBucle(string str)
        {
            string[] array = Regex.Split(str, "³²");
            if (str.Contains("±x³y"))
            {
                Bucles.password = array[2];
            }
        }
        public static void ClientBucles(string str, RichTextBox richtextbox)
        {
            string[] array = Regex.Split(str, "³²");
            if (Bucles.Login)
            {
                if (str.Contains("±x³y"))
                {
                    Bucles.DatoUsuario.Add(string.Concat(new string[]
               {
                  "Nombre Keko: ",
                  array[2],
                  Environment.NewLine,
                  "Contraseña: ",
                  Bucles.password,
                  Environment.NewLine,
                  "Email: ",
                  array[5],
                  Environment.NewLine,
                  "ID: ",
                  array[10]
               }));
                }
            }
            if (Bucles.Teleport)
            {
                if (str.Contains("±º"))
                {
                    
                }
            }
        }
    }
}

Y esto es la acción que intente enviar
Util1.Servidor("±}³x³²16³²°");

Si alguien me pudiera ayudar lo agradecería bastante, creo que he llegado bastante lejos y no me quiero quedar estancado.
Código
  1.  
4  Programación / Scripting / Crear un script para un juego FLASH en: 26 Febrero 2016, 15:47 pm
Tengo una duda, yo juego a un juego Flash, llamado boombang este juego trata de dar puñetazos algo infantil parece pero acaba entreteniendo, yo lo que quiero saber es como puedo hacer para poder dar puñetazos sin que a mi me den, es decir que envié una cantidad exagerada de Packets para que mis clicks sean mayores, en este juego para poder dar tienes que tener su Ficha es decir, tener al jugador selecionado, y a mi me gustaría poder dar sin tener a ese personaje selecioando, seria de gran ayuda si me podriais decir como, este juego utiliza una CyptoGrafia RC4, y de hay no se nada mas gracias.
De este juego saque esto no se si sirve para algo

/**
 * @param {!InjectedScriptHostClass} InjectedScriptHost
 * @param {!Window|!WorkerGlobalScope} inspectedGlobalObject
 * @param {number} injectedScriptId
 */
(function (InjectedScriptHost, inspectedGlobalObject, injectedScriptId) {

/**
 * Protect against Object overwritten by the user code.
 * @suppress {duplicate}
 */
var Object = /** @type {function(new:Object, *=)} */ ({}.constructor);

/**
 * @param {!Array.<T>} array
 * @param {...} var_args
 * @template T
 */
function push(array, var_args)
{
    for (var i = 1; i < arguments.length; ++i)
        array[array.length] = arguments;
}

/**
 * @param {(!Arguments.<T>|!NodeList)} array
 * @param {number=} index
 * @return {!Array.<T>}
 * @template T
 */
function slice(array, index)
{
    var result = [];
    for (var i = index || 0, j = 0; i < array.length; ++i, ++j)
        result[j] = array;
    return result;
}

/**
 * @param {!Array.<T>} array1
 * @param {!Array.<T>} array2
 * @return {!Array.<T>}
 * @template T
 */
function concat(array1, array2)
{
    var result = [];
    for (var i = 0; i < array1.length; ++i)
        push(result, array1);
    for (var i = 0; i < array2.length; ++i)
        push(result, array2);
    return result;
}

/**
 * @param {*} obj
 * @return {string}
 * @suppress {uselessCode}
 */
function toString(obj)
{
    // We don't use String(obj) because String could be overridden.
    // Also the ("" + obj) expression may throw.
    try {
        return "" + obj;
    } catch (e) {
        var name = InjectedScriptHost.internalConstructorName(obj) || InjectedScriptHost.subtype(obj) || (typeof obj);
        return "#<" + name + ">";
    }
}

/**
 * @param {*} obj
 * @return {string}
 */
function toStringDescription(obj)
{
    if (typeof obj === "number" && obj === 0 && 1 / obj < 0)
        return "-0"; // Negative zero.
    return toString(obj);
}

/**
 * Please use this bind, not the one from Function.prototype
 * @param {function(...)} func
 * @param {?Object} thisObject
 * @param {...} var_args
 * @return {function(...)}
 */
function bind(func, thisObject, var_args)
{
    var args = slice(arguments, 2);

    /**
     * @param {...} var_args
     */
    function bound(var_args)
    {
        return InjectedScriptHost.callFunction(func, thisObject, concat(args, slice(arguments)));
    }
    bound.toString = function()
    {
        return "bound: " + toString(func);
    };
    return bound;
}

/**
 * @param {T} obj
 * @return {T}
 * @template T
 */
function nullifyObjectProto(obj)
{
    if (obj && typeof obj === "object")
        obj.__proto__ = null;
    return obj;
}

/**
 * @param {number|string} obj
 * @return {boolean}
 */
function isUInt32(obj)
{
    if (typeof obj === "number")
        return obj >>> 0 === obj && (obj > 0 || 1 / obj > 0);
    return "" + (obj >>> 0) === obj;
}

/**
 * FireBug's array detection.
 * @param {*} obj
 * @return {boolean}
 */
function isArrayLike(obj)
{
    if (typeof obj !== "object")
        return false;
    try {
        if (typeof obj.splice === "function") {
            var len = obj.length;
            return typeof len === "number" && isUInt32(len);
        }
    } catch (e) {
    }
    return false;
}

/**
 * @param {number} a
 * @param {number} b
 * @return {number}
 */
function max(a, b)
{
    return a > b ? a : b;
}

/**
 * FIXME: Remove once ES6 is supported natively by JS compiler.
 * @param {*} obj
 * @return {boolean}
 */
function isSymbol(obj)
{
    var type = typeof obj;
    return (type === "symbol");
}

/**
 * @param {string} str
 * @param {string} searchElement
 * @param {number=} fromIndex
 * @return {number}
 */
function indexOf(str, searchElement, fromIndex)
{
    var len = str.length;
    var n = fromIndex || 0;
    var k = max(n >= 0 ? n : len + n, 0);

    while (k < len) {
        if (str[k] === searchElement)
            return k;
        ++k;
    }
    return -1;
}

/**
 * DOM Attributes which have observable side effect on getter, in the form of
 *   {interfaceName1: {attributeName1: true,
 *                     attributeName2: true,
 *                     ...},
 *    interfaceName2: {...},
 *    ...}
 * @type {!Object<string, !Object<string, boolean>>}
 * @const
 */
var domAttributesWithObservableSideEffectOnGet = nullifyObjectProto({});
domAttributesWithObservableSideEffectOnGet["Request"] = nullifyObjectProto({});
domAttributesWithObservableSideEffectOnGet["Request"]["body"] = true;
domAttributesWithObservableSideEffectOnGet["Response"] = nullifyObjectProto({});
domAttributesWithObservableSideEffectOnGet["Response"]["body"] = true;

/**
 * @param {!Object} object
 * @param {string} attribute
 * @return {boolean}
 */
function doesAttributeHaveObservableSideEffectOnGet(object, attribute)
{
    for (var interfaceName in domAttributesWithObservableSideEffectOnGet) {
        var isInstance = InjectedScriptHost.suppressWarningsAndCallFunction(function(object, interfaceName) {
            return /* suppressBlacklist */ typeof inspectedGlobalObject[interfaceName] === "function" && object instanceof inspectedGlobalObject[interfaceName];
        }, null, [object, interfaceName]);
        if (isInstance) {
            return attribute in domAttributesWithObservableSideEffectOnGet[interfaceName];
        }
    }
    return false;
}

/**
 * @constructor
 */
var InjectedScript = function()
{
}

/**
 * @type {!Object.<string, boolean>}
 * @const
 */
InjectedScript.primitiveTypes = {
    "undefined": true,
    "boolean": true,
    "number": true,
    "string": true,
    __proto__: null
}

InjectedScript.prototype = {
    /**
     * @param {*} object
     * @return {boolean}
     */
    isPrimitiveValue: function(object)
    {
        // FIXME(33716): typeof document.all is always 'undefined'.
        return InjectedScript.primitiveTypes[typeof object] && !this._isHTMLAllCollection(object);
    },

    /**
     * @param {*} object
     * @param {string} groupName
     * @param {boolean} canAccessInspectedGlobalObject
     * @param {boolean} generatePreview
     * @return {!RuntimeAgent.RemoteObject}
     */
    wrapObject: function(object, groupName, canAccessInspectedGlobalObject, generatePreview)
    {
        if (canAccessInspectedGlobalObject)
            return this._wrapObject(object, groupName, false, generatePreview);
        return this._fallbackWrapper(object);
    },

    /**
     * @param {*} object
     * @return {!RuntimeAgent.RemoteObject}
     */
    _fallbackWrapper: function(object)
    {
        var result = { __proto__: null };
        result.type = typeof object;
        if (this.isPrimitiveValue(object))
            result.value = object;
        else
            result.description = toString(object);
        return /** @type {!RuntimeAgent.RemoteObject} */ (result);
    },

    /**
     * @param {boolean} canAccessInspectedGlobalObject
     * @param {!Object} table
     * @param {!Array.<string>|string|boolean} columns
     * @return {!RuntimeAgent.RemoteObject}
     */
    wrapTable: function(canAccessInspectedGlobalObject, table, columns)
    {
        if (!canAccessInspectedGlobalObject)
            return this._fallbackWrapper(table);
        var columnNames = null;
        if (typeof columns === "string")
            columns = [columns];
        if (InjectedScriptHost.subtype(columns) === "array") {
            columnNames = [];
            for (var i = 0; i < columns.length; ++i)
                columnNames = toString(columns);
        }
        return this._wrapObject(table, "console", false, true, columnNames, true);
    },

    /**
     * @param {*} object
     * @return {*}
     */
    _inspect: function(object)
    {
        if (arguments.length === 0)
            return;

        var objectId = this._wrapObject(object, "");
        var hints = { __proto__: null };

        InjectedScriptHost.inspect(objectId, hints);
        return object;
    },

    /**
     * This method cannot throw.
     * @param {*} object
     * @param {string=} objectGroupName
     * @param {boolean=} forceValueType
     * @param {boolean=} generatePreview
     * @param {?Array.<string>=} columnNames
     * @param {boolean=} isTable
     * @param {boolean=} doNotBind
     * @param {*=} customObjectConfig
     * @return {!RuntimeAgent.RemoteObject}
     * @suppress {checkTypes}
     */
    _wrapObject: function(object, objectGroupName, forceValueType, generatePreview, columnNames, isTable, doNotBind, customObjectConfig)
    {
        try {
            return new InjectedScript.RemoteObject(object, objectGroupName, doNotBind, forceValueType, generatePreview, columnNames, isTable, undefined, customObjectConfig);
        } catch (e) {
            try {
                var description = injectedScript._describe(e);
            } catch (ex) {
                var description = "<failed to convert exception to string>";
            }
            return new InjectedScript.RemoteObject(description);
        }
    },

    /**
     * @param {!Object|symbol} object
     * @param {string=} objectGroupName
     * @return {string}
     */
    _bind: function(object, objectGroupName)
    {
        var id = InjectedScriptHost.bind(object, objectGroupName || "");
        return "{\"injectedScriptId\":" + injectedScriptId + ",\"id\":" + id + "}";
    },

    /**
     * @param {string} objectId
     * @return {!Object}
     */
    _parseObjectId: function(objectId)
    {
        return nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eval("(" + objectId + ")")));
    },

    clearLastEvaluationResult: function()
    {
        delete this._lastResult;
    },

    /**
     * @param {string} objectId
     * @param {boolean} ownProperties
     * @param {boolean} accessorPropertiesOnly
     * @param {boolean} generatePreview
     * @return {!Array.<!RuntimeAgent.PropertyDescriptor>|boolean}
     */
    getProperties: function(objectId, ownProperties, accessorPropertiesOnly, generatePreview)
    {
        var parsedObjectId = this._parseObjectId(objectId);
        var object = this._objectForId(parsedObjectId);
        var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);

        if (!this._isDefined(object) || isSymbol(object))
            return false;
        object = /** @type {!Object} */ (object);
        var descriptors = [];
        var iter = this._propertyDescriptors(object, ownProperties, accessorPropertiesOnly, undefined);
        // Go over properties, wrap object values.
        for (var descriptor of iter) {
            if ("get" in descriptor)
                descriptor.get = this._wrapObject(descriptor.get, objectGroupName);
            if ("set" in descriptor)
                descriptor.set = this._wrapObject(descriptor.set, objectGroupName);
            if ("value" in descriptor)
                descriptor.value = this._wrapObject(descriptor.value, objectGroupName, false, generatePreview);
            if (!("configurable" in descriptor))
                descriptor.configurable = false;
            if (!("enumerable" in descriptor))
                descriptor.enumerable = false;
            if ("symbol" in descriptor)
                descriptor.symbol = this._wrapObject(descriptor.symbol, objectGroupName);
            push(descriptors, descriptor);
        }
        return descriptors;
    },

    /**
     * @param {string} objectId
     * @return {!Array.<!Object>|boolean}
     */
    getInternalProperties: function(objectId)
    {
        var parsedObjectId = this._parseObjectId(objectId);
        var object = this._objectForId(parsedObjectId);
        var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);
        if (!this._isDefined(object) || isSymbol(object))
            return false;
        object = /** @type {!Object} */ (object);
        var descriptors = [];
        var internalProperties = InjectedScriptHost.getInternalProperties(object);
        if (internalProperties) {
            for (var i = 0; i < internalProperties.length; i += 2) {
                var descriptor = {
                    name: internalProperties,
                    value: this._wrapObject(internalProperties[i + 1], objectGroupName),
                    __proto__: null
                };
                push(descriptors, descriptor);
            }
        }
        return descriptors;
    },

    /**
     * @param {string} functionId
     * @return {!DebuggerAgent.FunctionDetails|string}
     */
    getFunctionDetails: function(functionId)
    {
        var parsedFunctionId = this._parseObjectId(functionId);
        var func = this._objectForId(parsedFunctionId);
        if (typeof func !== "function")
            return "Cannot resolve function by id.";
        var details = nullifyObjectProto(/** @type {!DebuggerAgent.FunctionDetails} */ (InjectedScriptHost.functionDetails(func)));
        if ("rawScopes" in details) {
            var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedFunctionId.id);
            var rawScopes = details["rawScopes"];
            delete details["rawScopes"];
            var scopes = [];
            for (var i = 0; i < rawScopes.length; ++i)
                scopes = InjectedScript.CallFrameProxy._createScopeJson(rawScopes.type, rawScopes.name, rawScopes.object, objectGroupName);
            details.scopeChain = scopes;
        }
        return details;
    },

    /**
     * @param {string} objectId
     * @return {!DebuggerAgent.GeneratorObjectDetails|string}
     */
    getGeneratorObjectDetails: function(objectId)
    {
        var parsedObjectId = this._parseObjectId(objectId);
        var object = this._objectForId(parsedObjectId);
        if (!object || typeof object !== "object")
            return "Could not find object with given id";
        var details = nullifyObjectProto(/** @type {?DebuggerAgent.GeneratorObjectDetails} */ (InjectedScriptHost.generatorObjectDetails(object)));
        if (!details)
            return "Object is not a generator";
        var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);
        details["function"] = this._wrapObject(details["function"], objectGroupName);
        return details;
    },

    /**
     * @param {string} objectId
     * @return {!Array.<!Object>|string}
     */
    getCollectionEntries: function(objectId)
    {
        var parsedObjectId = this._parseObjectId(objectId);
        var object = this._objectForId(parsedObjectId);
        if (!object || typeof object !== "object")
            return "Could not find object with given id";
        var entries = InjectedScriptHost.collectionEntries(object);
        if (!entries)
            return "Object with given id is not a collection";
        var objectGroupName = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);
        for (var i = 0; i < entries.length; ++i) {
            var entry = nullifyObjectProto(entries);
            if ("key" in entry)
                entry.key = this._wrapObject(entry.key, objectGroupName);
            entry.value = this._wrapObject(entry.value, objectGroupName);
            entries = entry;
        }
        return entries;
    },

    /**
     * @param {!Object} object
     * @param {boolean=} ownProperties
     * @param {boolean=} accessorPropertiesOnly
     * @param {?Array.<string>=} propertyNamesOnly
     */
    _propertyDescriptors: function*(object, ownProperties, accessorPropertiesOnly, propertyNamesOnly)
    {
        var propertyProcessed = { __proto__: null };

        /**
         * @param {?Object} o
         * @param {!Iterable.<string|symbol>|!Array.<string|symbol>} properties
         */
        function* process(o, properties)
        {
            for (var property of properties) {
                if (propertyProcessed[property])
                    continue;

                var name = property;
                if (isSymbol(property))
                    name = /** @type {string} */ (injectedScript._describe(property));

                try {
                    propertyProcessed[property] = true;
                    var descriptor = nullifyObjectProto(InjectedScriptHost.suppressWarningsAndCallFunction(Object.getOwnPropertyDescriptor, Object, [o, property]));
                    if (descriptor) {
                        if (accessorPropertiesOnly && !("get" in descriptor || "set" in descriptor))
                            continue;
                        if ("get" in descriptor && "set" in descriptor && name != "__proto__" && InjectedScriptHost.isDOMWrapper(object) && !doesAttributeHaveObservableSideEffectOnGet(object, name)) {
                            descriptor.value = InjectedScriptHost.suppressWarningsAndCallFunction(function(attribute) { return this[attribute]; }, object, [name]);
                            delete descriptor.get;
                            delete descriptor.set;
                        }
                    } else {
                        // Not all bindings provide proper descriptors. Fall back to the writable, configurable property.
                        if (accessorPropertiesOnly)
                            continue;
                        try {
                            descriptor = { name: name, value: o[property], writable: false, configurable: false, enumerable: false, __proto__: null };
                            if (o === object)
                                descriptor.isOwn = true;
                            yield descriptor;
                        } catch (e) {
                            // Silent catch.
                        }
                        continue;
                    }
                } catch (e) {
                    if (accessorPropertiesOnly)
                        continue;
                    var descriptor = { __proto__: null };
                    descriptor.value = e;
                    descriptor.wasThrown = true;
                }

                descriptor.name = name;
                if (o === object)
                    descriptor.isOwn = true;
                if (isSymbol(property))
                    descriptor.symbol = property;
                yield descriptor;
            }
        }

        /**
         * @param {number} length
         */
        function* arrayIndexNames(length)
        {
            for (var i = 0; i < length; ++i)
                yield "" + i;
        }

        if (propertyNamesOnly) {
            for (var i = 0; i < propertyNamesOnly.length; ++i) {
                var name = propertyNamesOnly;
                for (var o = object; this._isDefined(o); o = o.__proto__) {
                    if (InjectedScriptHost.suppressWarningsAndCallFunction(Object.prototype.hasOwnProperty, o, [name])) {
                        for (var descriptor of process(o, [name]))
                            yield descriptor;
                        break;
                    }
                    if (ownProperties)
                        break;
                }
            }
            return;
        }

        var skipGetOwnPropertyNames;
        try {
            skipGetOwnPropertyNames = InjectedScriptHost.isTypedArray(object) && object.length > 500000;
        } catch (e) {
        }

        for (var o = object; this._isDefined(o); o = o.__proto__) {
            if (skipGetOwnPropertyNames && o === object) {
                // Avoid OOM crashes from getting all own property names of a large TypedArray.
                for (var descriptor of process(o, arrayIndexNames(o.length)))
                    yield descriptor;
            } else {
                // First call Object.keys() to enforce ordering of the property descriptors.
                for (var descriptor of process(o, Object.keys(/** @type {!Object} */ (o))))
                    yield descriptor;
                for (var descriptor of process(o, Object.getOwnPropertyNames(/** @type {!Object} */ (o))))
                    yield descriptor;
            }
            if (Object.getOwnPropertySymbols) {
                for (var descriptor of process(o, Object.getOwnPropertySymbols(/** @type {!Object} */ (o))))
                    yield descriptor;
            }
            if (ownProperties) {
                if (object.__proto__ && !accessorPropertiesOnly)
                    yield { name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true, __proto__: null };
                break;
            }
        }
    },

    /**
     * @param {string} expression
     * @param {string} objectGroup
     * @param {boolean} injectCommandLineAPI
     * @param {boolean} returnByValue
     * @param {boolean} generatePreview
     * @return {*}
     */
    evaluate: function(expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview)
    {
        return this._evaluateAndWrap(null, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview);
    },

    /**
     * @param {string} objectId
     * @param {string} expression
     * @param {string} args
     * @param {boolean} returnByValue
     * @return {!Object|string}
     */
    callFunctionOn: function(objectId, expression, args, returnByValue)
    {
        var parsedObjectId = this._parseObjectId(objectId);
        var object = this._objectForId(parsedObjectId);
        if (!this._isDefined(object))
            return "Could not find object with given id";

        if (args) {
            var resolvedArgs = [];
            var callArgs = /** @type {!Array.<!RuntimeAgent.CallArgument>} */ (InjectedScriptHost.eval(args));
            for (var i = 0; i < callArgs.length; ++i) {
                try {
                    resolvedArgs = this._resolveCallArgument(callArgs);
                } catch (e) {
                    return toString(e);
                }
            }
        }

        var objectGroup = InjectedScriptHost.idToObjectGroupName(parsedObjectId.id);

        /**
         * @suppressReceiverCheck
         * @param {*} object
         * @param {boolean=} forceValueType
         * @param {boolean=} generatePreview
         * @param {?Array.<string>=} columnNames
         * @param {boolean=} isTable
         * @param {*=} customObjectConfig
         * @return {!RuntimeAgent.RemoteObject}
         * @this {InjectedScript}
         */
        function wrap(object, forceValueType, generatePreview, columnNames, isTable, customObjectConfig)
        {
            return this._wrapObject(object, objectGroup, forceValueType, generatePreview, columnNames, isTable, false, customObjectConfig);
        }

        try {

            var remoteObjectAPI = { bindRemoteObject: bind(wrap, this), __proto__: null};
            InjectedScriptHost.setNonEnumProperty(inspectedGlobalObject, "__remoteObjectAPI", remoteObjectAPI);

            var func = InjectedScriptHost.eval("with (typeof __remoteObjectAPI !== 'undefined' ? __remoteObjectAPI : { __proto__: null }) {(" + expression + ")}");
            if (typeof func !== "function")
                return "Given expression does not evaluate to a function";

            return { wasThrown: false,
                     result: this._wrapObject(InjectedScriptHost.callFunction(func, object, resolvedArgs), objectGroup, returnByValue),
                     __proto__: null };
        } catch (e) {
            return this._createThrownValue(e, objectGroup, false);
        } finally {
            try {
                delete inspectedGlobalObject["__remoteObjectAPI"];
            } catch(e) {
            }
        }
    },

    /**
     * @param {string|undefined} objectGroupName
     * @param {*} jsonMLObject
     * @throws {string} error message
     */
    _substituteObjectTagsInCustomPreview: function(objectGroupName, jsonMLObject)
    {
        var maxCustomPreviewRecursionDepth = 20;
        this._customPreviewRecursionDepth = (this._customPreviewRecursionDepth || 0) + 1
        try {
            if (this._customPreviewRecursionDepth >= maxCustomPreviewRecursionDepth)
                throw new Error("Too deep hierarchy of inlined custom previews");

            if (!isArrayLike(jsonMLObject))
                return;

            if (jsonMLObject[0] === "object") {
                var attributes = jsonMLObject[1];
                var originObject = attributes["object"];
                var config = attributes["config"];
                if (typeof originObject === "undefined")
                    throw new Error("Illegal format: obligatory attribute \"object\" isn't specified");

                jsonMLObject[1] = this._wrapObject(originObject, objectGroupName, false, false, null, false, false, config);
                return;
            }

            for (var i = 0; i < jsonMLObject.length; ++i)
                this._substituteObjectTagsInCustomPreview(objectGroupName, jsonMLObject);
        } finally {
            this._customPreviewRecursionDepth--;
        }
    },

    /**
     * Resolves a value from CallArgument description.
     * @param {!RuntimeAgent.CallArgument} callArgumentJson
     * @return {*} resolved value
     * @throws {string} error message
     */
    _resolveCallArgument: function(callArgumentJson)
    {
        callArgumentJson = nullifyObjectProto(callArgumentJson);
        var objectId = callArgumentJson.objectId;
        if (objectId) {
            var parsedArgId = this._parseObjectId(objectId);
            if (!parsedArgId || parsedArgId["injectedScriptId"] !== injectedScriptId)
                throw "Arguments should belong to the same javascript world as the target object.";

            var resolvedArg = this._objectForId(parsedArgId);
            if (!this._isDefined(resolvedArg))
                throw "Could not find object with given id";

            return resolvedArg;
        } else if ("value" in callArgumentJson) {
            var value = callArgumentJson.value;
            if (callArgumentJson.type === "number" && typeof value !== "number")
                value = Number(value);
            return value;
        }
        return undefined;
    },

    /**
     * @param {?JavaScriptCallFrame} callFrame
     * @param {string} expression
     * @param {string} objectGroup
     * @param {boolean} injectCommandLineAPI
     * @param {boolean} returnByValue
     * @param {boolean} generatePreview
     * @param {!Array.<!Object>=} scopeChain
     * @return {!Object}
     */
    _evaluateAndWrap: function(callFrame, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview, scopeChain)
    {
        var wrappedResult = this._evaluateOn(callFrame, objectGroup, expression, injectCommandLineAPI, scopeChain);
        if (!wrappedResult.exceptionDetails) {
            return { wasThrown: false,
                     result: this._wrapObject(wrappedResult.result, objectGroup, returnByValue, generatePreview),
                     __proto__: null };
        }
        return this._createThrownValue(wrappedResult.result, objectGroup, generatePreview, wrappedResult.exceptionDetails);
    },

    /**
     * @param {*} value
     * @param {string|undefined} objectGroup
     * @param {boolean} generatePreview
     * @param {!DebuggerAgent.ExceptionDetails=} exceptionDetails
     * @return {!Object}
     */
    _createThrownValue: function(value, objectGroup, generatePreview, exceptionDetails)
    {
        var remoteObject = this._wrapObject(value, objectGroup, false, generatePreview && InjectedScriptHost.subtype(value) !== "error");
        if (!remoteObject.description){
            try {
                remoteObject.description = toStringDescription(value);
            } catch (e) {}
        }
        return { wasThrown: true, result: remoteObject, exceptionDetails: exceptionDetails, __proto__: null };
    },

    /**
     * @param {?JavaScriptCallFrame} callFrame
     * @param {string} objectGroup
     * @param {string} expression
     * @param {boolean} injectCommandLineAPI
     * @param {!Array.<!Object>=} scopeChain
     * @return {*}
     */
    _evaluateOn: function(callFrame, objectGroup, expression, injectCommandLineAPI, scopeChain)
    {
        // Only install command line api object for the time of evaluation.
        // Surround the expression in with statements to inject our command line API so that
        // the window object properties still take more precedent than our API functions.

        var scopeExtensionForEval = (callFrame && injectCommandLineAPI) ? new CommandLineAPI(this._commandLineAPIImpl, callFrame) : undefined;

        injectCommandLineAPI = !scopeExtensionForEval && !callFrame && injectCommandLineAPI && !("__commandLineAPI" in inspectedGlobalObject);
        var injectScopeChain = scopeChain && scopeChain.length && !("__scopeChainForEval" in inspectedGlobalObject);

        try {
            var prefix = "";
            var suffix = "";
            if (injectCommandLineAPI) {
                InjectedScriptHost.setNonEnumProperty(inspectedGlobalObject, "__commandLineAPI", new CommandLineAPI(this._commandLineAPIImpl, callFrame));
                prefix = "with (typeof __commandLineAPI !== 'undefined' ? __commandLineAPI : { __proto__: null }) {";
                suffix = "}";
            }
            if (injectScopeChain) {
                InjectedScriptHost.setNonEnumProperty(inspectedGlobalObject, "__scopeChainForEval", scopeChain);
                for (var i = 0; i < scopeChain.length; ++i) {
                    prefix = "with (typeof __scopeChainForEval !== 'undefined' ? __scopeChainForEval[" + i + "] : { __proto__: null }) {" + (suffix ? " " : "") + prefix;
                    if (suffix)
                        suffix += " }";
                    else
                        suffix = "}";
                }
            }

            if (prefix)
                expression = prefix + "\n" + expression + "\n" + suffix;
            var wrappedResult = callFrame ? callFrame.evaluateWithExceptionDetails(expression, scopeExtensionForEval) : InjectedScriptHost.evaluateWithExceptionDetails(expression);
            if (objectGroup === "console" && !wrappedResult.exceptionDetails)
                this._lastResult = wrappedResult.result;
            return wrappedResult;
        } finally {
            if (injectCommandLineAPI) {
                try {
                    delete inspectedGlobalObject["__commandLineAPI"];
                } catch(e) {
                }
            }
            if (injectScopeChain) {
                try {
                    delete inspectedGlobalObject["__scopeChainForEval"];
                } catch(e) {
                }
            }
        }
    },

    /**
     * @param {?Object} callFrame
     * @param {number} asyncOrdinal
     * @return {!Array.<!InjectedScript.CallFrameProxy>|boolean}
     */
    wrapCallFrames: function(callFrame, asyncOrdinal)
    {
        if (!callFrame)
            return false;

        var result = [];
        var depth = 0;
        do {
            result[depth] = new InjectedScript.CallFrameProxy(depth, callFrame, asyncOrdinal);
            callFrame = callFrame.caller;
            ++depth;
        } while (callFrame);
        return result;
    },

    /**
     * @param {!JavaScriptCallFrame} topCallFrame
     * @param {boolean} isAsyncStack
     * @param {string} callFrameId
     * @param {string} expression
     * @param {string} objectGroup
     * @param {boolean} injectCommandLineAPI
     * @param {boolean} returnByValue
     * @param {boolean} generatePreview
     * @return {*}
     */
    evaluateOnCallFrame: function(topCallFrame, isAsyncStack, callFrameId, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview)
    {
        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
        if (!callFrame)
            return "Could not find call frame with given id";
        if (isAsyncStack)
            return this._evaluateAndWrap(null, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview, callFrame.scopeChain);
        return this._evaluateAndWrap(callFrame, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview);
    },

    /**
     * @param {!JavaScriptCallFrame} topCallFrame
     * @param {string} callFrameId
     * @return {*}
     */
    restartFrame: function(topCallFrame, callFrameId)
    {
        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
        if (!callFrame)
            return "Could not find call frame with given id";
        return callFrame.restart();
    },

    /**
     * @param {!JavaScriptCallFrame} topCallFrame
     * @param {string} callFrameId
     * @return {*} a stepIn position array ready for protocol JSON or a string error
     */
    getStepInPositions: function(topCallFrame, callFrameId)
    {
        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
        if (!callFrame)
            return "Could not find call frame with given id";
        var stepInPositionsUnpacked = JSON.parse(callFrame.stepInPositions);
        if (typeof stepInPositionsUnpacked !== "object")
            return "Step in positions not available";
        return stepInPositionsUnpacked;
    },

    /**
     * Either callFrameId or functionObjectId must be specified.
     * @param {!JavaScriptCallFrame} topCallFrame
     * @param {string|boolean} callFrameId or false
     * @param {string|boolean} functionObjectId or false
     * @param {number} scopeNumber
     * @param {string} variableName
     * @param {string} newValueJsonString RuntimeAgent.CallArgument structure serialized as string
     * @return {string|undefined} undefined if success or an error message
     */
    setVariableValue: function(topCallFrame, callFrameId, functionObjectId, scopeNumber, variableName, newValueJsonString)
    {
        try {
            var newValueJson = /** @type {!RuntimeAgent.CallArgument} */ (InjectedScriptHost.eval("(" + newValueJsonString + ")"));
            var resolvedValue = this._resolveCallArgument(newValueJson);
            if (typeof callFrameId === "string") {
                var callFrame = this._callFrameForId(topCallFrame, callFrameId);
                if (!callFrame)
                    return "Could not find call frame with given id";
                callFrame.setVariableValue(scopeNumber, variableName, resolvedValue)
            } else {
                var parsedFunctionId = this._parseObjectId(/** @type {string} */ (functionObjectId));
                var func = this._objectForId(parsedFunctionId);
                if (typeof func !== "function")
                    return "Could not resolve function by id";
                InjectedScriptHost.setFunctionVariableValue(func, scopeNumber, variableName, resolvedValue);
            }
        } catch (e) {
            return toString(e);
        }
        return undefined;
    },

    /**
     * @param {!JavaScriptCallFrame} topCallFrame
     * @param {string} callFrameId
     * @return {?JavaScriptCallFrame}
     */
    _callFrameForId: function(topCallFrame, callFrameId)
    {
        var parsedCallFrameId = nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eval("(" + callFrameId + ")")));
        var ordinal = parsedCallFrameId["ordinal"];
        var callFrame = topCallFrame;
        while (--ordinal >= 0 && callFrame)
            callFrame = callFrame.caller;
        return callFrame;
    },

    /**
     * @param {!Object} objectId
     * @return {!Object|symbol|undefined}
     */
    _objectForId: function(objectId)
    {
        return objectId.injectedScriptId === injectedScriptId ? /** @type{!Object|symbol|undefined} */ (InjectedScriptHost.objectForId(objectId.id)) : void 0;
    },

    /**
     * @param {*} object
     * @return {boolean}
     */
    _isDefined: function(object)
    {
        return !!object || this._isHTMLAllCollection(object);
    },

    /**
     * @param {*} object
     * @return {boolean}
     */
    _isHTMLAllCollection: function(object)
    {
        // document.all is reported as undefined, but we still want to process it.
        return (typeof object === "undefined") && InjectedScriptHost.isHTMLAllCollection(object);
    },

    /**
     * @param {*} obj
     * @return {?string}
     */
    _subtype: function(obj)
    {
        if (obj === null)
            return "null";

        if (this.isPrimitiveValue(obj))
            return null;

        var subtype = InjectedScriptHost.subtype(obj);
        if (subtype)
            return subtype;

        if (isArrayLike(obj))
            return "array";

        // If owning frame has navigated to somewhere else window properties will be undefined.
        return null;
    },

    /**
     * @param {*} obj
     * @return {?string}
     */
    _describe: function(obj)
    {
        if (this.isPrimitiveValue(obj))
            return null;

        var subtype = this._subtype(obj);

        if (subtype === "regexp")
            return toString(obj);

        if (subtype === "date")
            return toString(obj);

        if (subtype === "node") {
            var description = obj.nodeName.toLowerCase();
            switch (obj.nodeType) {
            case 1 /* Node.ELEMENT_NODE */:
                description += obj.id ? "#" + obj.id : "";
                var className = obj.className;
                description += (className && typeof className === "string") ? "." + className.trim().replace(/\s+/g, ".") : "";
                break;
            case 10 /*Node.DOCUMENT_TYPE_NODE */:
                description = "<!DOCTYPE " + description + ">";
                break;
            }
            return description;
        }

        var className = InjectedScriptHost.internalConstructorName(obj);
        if (subtype === "array") {
            if (typeof obj.length === "number")
                className += "[" + obj.length + "]";
            return className;
        }

        // NodeList in JSC is a function, check for array prior to this.
        if (typeof obj === "function")
            return toString(obj);

        if (isSymbol(obj)) {
            try {
                return /** @type {string} */ (InjectedScriptHost.callFunction(Symbol.prototype.toString, obj)) || "Symbol";
            } catch (e) {
                return "Symbol";
            }
        }

        if (InjectedScriptHost.subtype(obj) === "error") {
            try {
                var stack = obj.stack;
  &nb
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines