Esempio n. 1
0
 public MainForm()
 {
     InitializeComponent();
     Shown += (s, e) => GUIHelpers.Transitions.ShowForm(this, 1, 0.1, 10);
     GUIHelpers.DragControl dc = new GUIHelpers.DragControl(this);
     dc.Add(pnlHeader);
     btnExit.Click += (s, e) => Process.GetCurrentProcess().Kill();
     SetHandlers();
     SetDefaults();
     btnImage.Click += (s, e) =>
     {
         for (int i = 0; i < 6; i++)
         {
             char[] arr = new char[6] {
                 '#', '#', '#', '#', '#', '#'
             };
             arr[i] = '@';
             C_CHAT packet = new C_CHAT();
             packet.Message    = $"<FONT>{new string(arr)}</FONT>";
             packet.TextOffset = 10;
             packet.Channel    = Tera.Core.Game.ChatChannel.Global;
             PacketController.Send(packet);
         }
     };
 }
Esempio n. 2
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            PacketReflectionInfo info = PacketController.Client.Processor.Serializer.Info[cbxOps.Text];
            Object pObject            = Activator.CreateInstance(info.Type);
            int    length             = info.Fields.Length;

            for (int i = 0; i < length; i++)
            {
                FieldInfo field = info.Fields[i];
                field.SetValue(pObject, _controls[i].FieldValue);
            }
            PacketController.Send((Packet)pObject);
        }
Esempio n. 3
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            string[] splitted = tbData.Text.Split(SPLITTER);
            if (splitted == null || splitted.Length < 4)
            {
                MessageBox.Show("HEX-code contains to little data.", "Terax", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            byte[] data   = new byte[splitted.Length];
            int    length = data.Length;

            for (int i = 0; i < length; i++)
            {
                if (!splitted[i].IsHex())
                {
                    MessageBox.Show("HEX-code contains wrong data.", "Terax", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                data[i] = splitted[i].ToByte();
            }
            PacketDirection direction = (PacketDirection)cbxDirection.SelectedIndex;

            if (cbEncrypt.Selected)
            {
                if (lblOpName.Text.Equals(NONE))
                {
                    MessageBox.Show("Byte-code is wrong. Check your OpCode.", "Terax", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                if (data.Length != (data[0] | data[1] << 8))
                {
                    MessageBox.Show($"Wrong length of hex-code. Should be: {(data[0] | data[1] << 8)}", "Terax", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                switch (direction)
                {
                case PacketDirection.ClientToServer: PacketController.Send(new RawPacket(data, direction)); break;

                case PacketDirection.ServerToClient:
                    PacketController.Client.CPacket = new RawPacket(data, direction);
                    PacketController.Send(new RawPacket(new byte[] { 0x04, 0x00, 0xFE, 0xFF }, PacketDirection.ClientToServer));
                    break;
                }
            }
            else
            {
                PacketController.Send(data, direction);
            }
        }