예제 #1
0
        private void send_packet_button_Click(object sender, RoutedEventArgs e)
        {
            if (_is_intercepting == false)
            {
                return;
            }

            if (selected_packet_status.Content.ToString() != "INTERCEPTED PACKET (READ+WRITE)")
            {
                MessageBox.Show("Warning: The selected paket is an old packet, it cannot be sent now", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            System.Windows.Forms.Integration.WindowsFormsHost host = (WindowsFormsHost)grid1.Children[_child_id];

            Be.Windows.Forms.HexBox my_hex_box = (Be.Windows.Forms.HexBox)host.Child;

            List <byte> send_bytes = new List <byte>();

            for (uint i = 0; i < my_hex_box.ByteProvider.Length; i++)
            {
                send_bytes.Add(my_hex_box.ByteProvider.ReadByte(i));
            }

            my_hex_box.ByteProvider = new Be.Windows.Forms.DynamicByteProvider(new List <byte>());
            my_hex_box.ReadOnly     = true;

            ui_send_intercepted_packet(send_bytes);

            selected_packet_status.Content = "NO PACKET (READONLY)";
        }
예제 #2
0
        private void toggle_intercept_button_Click(object sender, RoutedEventArgs e)
        {
            if (_is_intercepting == true)
            {
                System.Windows.Forms.Integration.WindowsFormsHost host = (WindowsFormsHost)grid1.Children[_child_id];

                Be.Windows.Forms.HexBox my_hex_box = (Be.Windows.Forms.HexBox)host.Child;

                List <byte> send_bytes = new List <byte>();

                for (uint i = 0; i < my_hex_box.ByteProvider.Length; i++)
                {
                    send_bytes.Add(my_hex_box.ByteProvider.ReadByte(i));
                }

                my_hex_box.ByteProvider = new Be.Windows.Forms.DynamicByteProvider(new List <byte>());
                my_hex_box.ReadOnly     = true;

                ui_send_intercepted_packet(send_bytes);

                selected_packet_status.Content = "NO PACKET (READONLY)";
            }

            _is_intercepting = !_is_intercepting;

            intercept_status.Content = "Intercepting: " + (_is_intercepting == true ? "yes" : "no");

            if (_is_intercepting == false)
            {
                cGlobalState.ui_toggle_intercept(_stream_id, "false", "127.0.0.1:1231");
                return;
            }

            _intercepting_client = ui_tcp_wait_for_connection();
        }
예제 #3
0
 public void PluginSelected()
 {
     Be.Windows.Forms.HexBox              box = (Be.Windows.Forms.HexBox)Controls[0];
     Be.Windows.Forms.ByteCollection      c   = new Be.Windows.Forms.ByteCollection(Data.Buffer);
     Be.Windows.Forms.DynamicByteProvider d   = new Be.Windows.Forms.DynamicByteProvider(Data.Buffer);
     ((Be.Windows.Forms.HexBox)Controls[0]).ByteProvider = d;
 }
예제 #4
0
        private void ui_handle_intercept()
        {
            if (_is_intercepting == false)
            {
                return;
            }

            System.Windows.Forms.Integration.WindowsFormsHost host = (WindowsFormsHost)grid1.Children[_child_id];

            Be.Windows.Forms.HexBox my_hex_box = (Be.Windows.Forms.HexBox)host.Child;

            if (_intercepting_client.Client.Available < 4)
            {
                return;
            }

            selected_packet_status.Content = "INTERCEPTED PACKET (READ+WRITE)";

            List <byte> new_bytes = ui_receive_intercepted_packet();

            my_hex_box.ByteProvider      = new Be.Windows.Forms.DynamicByteProvider(new_bytes);
            my_hex_box.StringViewVisible = true;
            my_hex_box.VScrollBarVisible = true;
            my_hex_box.ReadOnly          = false;
        }
예제 #5
0
        void CopyMethod(object sender, EventArgs e, Be.Windows.Forms.HexBox hexBox)
        {
            byte[] targetBytes = new byte[hexBox.SelectionLength];
            Array.Copy(hexBox.GetAllBytes(), hexBox.SelectionStart, targetBytes, 0, hexBox.SelectionLength);
            string hex = BitConverter.ToString(targetBytes).Replace("-", string.Empty);

            Clipboard.SetText(hex);
        }
        public ClassEditResourceHandler(frmClassEdit form)
        {
            _form = form;

            detailsTabPage = _form.DetailsTabPage;

            txtResource = _form.ResourceText;
            pbResource = _form.ResourceImage;
            hbResource = _form.ResourceBinary;
            lvResource = _form.ResourceListView;
            panelResource = _form.ResourcePanel;

            dgBody = _form.BodyDataGrid;
            dgResource = _form.ResourceDataGrid;

            CreateDataTable();
        }
예제 #7
0
        public HexEditor()
        {
            Classifications = new EditorClassifications();
            FileExtensions = "Data file (*.dat)|*.dat";
            StaticFileExtensions = "Data file (*.dat)|*.dat";

            Controls = new Control[1];
            Be.Windows.Forms.HexBox box = new Be.Windows.Forms.HexBox();
            box.StringViewVisible = true;
            box.UseFixedBytesPerLine = true;
            box.LineInfoVisible = true;
            box.VScrollBarVisible = true;
            box.Dock = DockStyle.Fill;
            Controls[0] = box;

            ToolControls = new Control[0];
        }
예제 #8
0
        public HexEditor()
        {
            Classifications      = new EditorClassifications();
            FileExtensions       = "Data file (*.dat)|*.dat";
            StaticFileExtensions = "Data file (*.dat)|*.dat";

            Controls = new Control[1];
            Be.Windows.Forms.HexBox box = new Be.Windows.Forms.HexBox();
            box.StringViewVisible    = true;
            box.UseFixedBytesPerLine = true;
            box.LineInfoVisible      = true;
            box.VScrollBarVisible    = true;
            box.Dock    = DockStyle.Fill;
            Controls[0] = box;

            ToolControls = new Control[0];
        }
예제 #9
0
        private void Packet_stream_view_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (packet_stream_view.SelectedIndex == -1)
            {
                return;
            }

            if (selected_packet_status.Content.ToString() == "INTERCEPTED PACKET (READ+WRITE)")
            {
                MessageBox.Show("Warning: first send the intercepted packet using the 'send packet' button", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            var packet_display_object = packet_stream_view.SelectedItem;

            if ((string)object_helper.get_object_value(packet_display_object, "PayloadLength") == "0")
            {
                return;
            }

            int packet_number = int.Parse((string)object_helper.get_object_value(packet_display_object, "PacketNumber"));

            List <byte> packet_bytes = _packet_bytes[packet_number];

            System.Windows.Forms.Integration.WindowsFormsHost host = (WindowsFormsHost)grid1.Children[_child_id];

            Be.Windows.Forms.HexBox my_hex_box = (Be.Windows.Forms.HexBox)host.Child;

            my_hex_box.ByteProvider      = new Be.Windows.Forms.DynamicByteProvider(packet_bytes);
            my_hex_box.StringViewVisible = true;
            my_hex_box.VScrollBarVisible = true;
            my_hex_box.ReadOnly          = true;

            selected_packet_status.Content = "OLD PACKET (READONLY)";

            //grid1.Children[0].

            //packet_hex_editor.Stream = new System.IO.MemoryStream(packet_bytes.ToArray());
            //packet_hex_editor.ReadOnlyMode = true;
        }
예제 #10
0
        private void SendToRepeater_Click(object sender, RoutedEventArgs e)
        {
            if (_stream_type != "tcp")
            {
                MessageBox.Show("Warning: UDP repeating is not yet supported", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            var packet_display_object = packet_stream_view.SelectedItem;

            if ((string)object_helper.get_object_value(packet_display_object, "PayloadLength") == "0")
            {
                return;
            }

            int packet_number = int.Parse((string)object_helper.get_object_value(packet_display_object, "PacketNumber"));

            List <byte> packet_bytes = _packet_bytes[packet_number];

            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
            var hex_box = new Be.Windows.Forms.HexBox {
                Dock = System.Windows.Forms.DockStyle.Fill
            };

            host.Child = hex_box;

            Grid repeater_tab_grid = new Grid();

            repeater_tab_grid.HorizontalAlignment = HorizontalAlignment.Stretch;
            repeater_tab_grid.VerticalAlignment   = VerticalAlignment.Stretch;

            RowDefinition row_one = new RowDefinition();
            RowDefinition row_two = new RowDefinition();

            row_one.Height = new GridLength(80, GridUnitType.Star);
            row_two.Height = new GridLength(20, GridUnitType.Star);

            repeater_tab_grid.RowDefinitions.Add(row_one);
            repeater_tab_grid.RowDefinitions.Add(row_two);

            Button send_button = new Button();

            send_button.Content             = "Send packet";
            send_button.HorizontalAlignment = HorizontalAlignment.Left;
            send_button.VerticalAlignment   = VerticalAlignment.Stretch;


            hex_box.ByteProvider      = new Be.Windows.Forms.DynamicByteProvider(packet_bytes);
            hex_box.StringViewVisible = true;
            hex_box.VScrollBarVisible = true;

            send_button.Click += new RoutedEventHandler(delegate(object inner_sender, RoutedEventArgs inner_e)
            {
                List <byte> send_bytes = new List <byte>();

                for (uint i = 0; i < hex_box.ByteProvider.Length; i++)
                {
                    send_bytes.Add(hex_box.ByteProvider.ReadByte(i));
                }

                cGlobalState.ui_proxy_repeat_packet(_stream_id, send_bytes);
            });

            Grid.SetRow(send_button, 1);
            Grid.SetRow(host, 0);

            repeater_tab_grid.Children.Add(host);
            repeater_tab_grid.Children.Add(send_button);

            TabItem new_tab = new TabItem();

            new_tab.Header  = "Repeater_" + packet_number.ToString() + "_" + (tab_counter++).ToString();
            new_tab.Content = repeater_tab_grid;

            repeater_tab.Items.Add(new_tab);
        }
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.StopCaptureButton = new System.Windows.Forms.Button();
     this.comboBox1 = new System.Windows.Forms.ComboBox();
     this.hexBox1 = new Be.Windows.Forms.HexBox();
     this.CaptureButton = new System.Windows.Forms.Button();
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
     this.panel1 = new System.Windows.Forms.Panel();
     this.promiscuousCheckbox = new System.Windows.Forms.CheckBox();
     this.DumpToFileCheckbox = new System.Windows.Forms.CheckBox();
     this.FilterTextBox = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.AmberPicture = new System.Windows.Forms.PictureBox();
     this.RedPicture = new System.Windows.Forms.PictureBox();
     this.GreenPicture = new System.Windows.Forms.PictureBox();
     this.textBox1 = new System.Windows.Forms.TextBox();
     this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     this.panel2 = new System.Windows.Forms.Panel();
     this.label2 = new System.Windows.Forms.Label();
     this.splitContainer2 = new System.Windows.Forms.SplitContainer();
     this.tabControl1 = new System.Windows.Forms.TabControl();
     this.tabPage1 = new System.Windows.Forms.TabPage();
     this.tabPage2 = new System.Windows.Forms.TabPage();
     this.tabPage3 = new System.Windows.Forms.TabPage();
     this.treeView1 = new System.Windows.Forms.TreeView();
     this.FilteringTabPage = new System.Windows.Forms.TabPage();
     this.webBrowser1 = new System.Windows.Forms.WebBrowser();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.AmberPicture)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.RedPicture)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.GreenPicture)).BeginInit();
     this.splitContainer1.Panel1.SuspendLayout();
     this.splitContainer1.Panel2.SuspendLayout();
     this.splitContainer1.SuspendLayout();
     this.panel2.SuspendLayout();
     this.splitContainer2.Panel1.SuspendLayout();
     this.splitContainer2.Panel2.SuspendLayout();
     this.splitContainer2.SuspendLayout();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     this.tabPage2.SuspendLayout();
     this.tabPage3.SuspendLayout();
     this.FilteringTabPage.SuspendLayout();
     this.SuspendLayout();
     //
     // StopCaptureButton
     //
     this.StopCaptureButton.Location = new System.Drawing.Point(272, 29);
     this.StopCaptureButton.Name = "StopCaptureButton";
     this.StopCaptureButton.Size = new System.Drawing.Size(89, 23);
     this.StopCaptureButton.TabIndex = 1;
     this.StopCaptureButton.Text = "Stop Capture";
     this.StopCaptureButton.UseVisualStyleBackColor = true;
     this.StopCaptureButton.Click += new System.EventHandler(this.StopCaptureButton_Click);
     //
     // comboBox1
     //
     this.comboBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.comboBox1.FormattingEnabled = true;
     this.comboBox1.Location = new System.Drawing.Point(44, 0);
     this.comboBox1.Name = "comboBox1";
     this.comboBox1.Size = new System.Drawing.Size(180, 21);
     this.comboBox1.TabIndex = 0;
     this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
     //
     // hexBox1
     //
     this.hexBox1.BytesPerLine = 8;
     this.hexBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.hexBox1.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.hexBox1.LineInfoForeColor = System.Drawing.Color.Empty;
     this.hexBox1.LineInfoVisible = true;
     this.hexBox1.Location = new System.Drawing.Point(3, 3);
     this.hexBox1.Name = "hexBox1";
     this.hexBox1.ReadOnly = true;
     this.hexBox1.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255)))));
     this.hexBox1.Size = new System.Drawing.Size(547, 301);
     this.hexBox1.StringViewVisible = true;
     this.hexBox1.TabIndex = 2;
     this.hexBox1.UseFixedBytesPerLine = true;
     this.hexBox1.VScrollBarVisible = true;
     //
     // CaptureButton
     //
     this.CaptureButton.Location = new System.Drawing.Point(272, 3);
     this.CaptureButton.Name = "CaptureButton";
     this.CaptureButton.Size = new System.Drawing.Size(89, 23);
     this.CaptureButton.TabIndex = 0;
     this.CaptureButton.Text = "Start Capture";
     this.CaptureButton.UseVisualStyleBackColor = true;
     this.CaptureButton.Click += new System.EventHandler(this.CaptureButton_Click);
     //
     // listBox1
     //
     this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.listBox1.FormattingEnabled = true;
     this.listBox1.Location = new System.Drawing.Point(0, 58);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(561, 134);
     this.listBox1.TabIndex = 1;
     this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
     //
     // propertyGrid1
     //
     this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.propertyGrid1.Location = new System.Drawing.Point(0, 23);
     this.propertyGrid1.Name = "propertyGrid1";
     this.propertyGrid1.Size = new System.Drawing.Size(224, 511);
     this.propertyGrid1.TabIndex = 1;
     //
     // panel1
     //
     this.panel1.Controls.Add(this.promiscuousCheckbox);
     this.panel1.Controls.Add(this.DumpToFileCheckbox);
     this.panel1.Controls.Add(this.FilterTextBox);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.AmberPicture);
     this.panel1.Controls.Add(this.RedPicture);
     this.panel1.Controls.Add(this.GreenPicture);
     this.panel1.Controls.Add(this.StopCaptureButton);
     this.panel1.Controls.Add(this.CaptureButton);
     this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(561, 58);
     this.panel1.TabIndex = 0;
     //
     // promiscuousCheckbox
     //
     this.promiscuousCheckbox.AutoSize = true;
     this.promiscuousCheckbox.Location = new System.Drawing.Point(164, 29);
     this.promiscuousCheckbox.Name = "promiscuousCheckbox";
     this.promiscuousCheckbox.Size = new System.Drawing.Size(86, 17);
     this.promiscuousCheckbox.TabIndex = 9;
     this.promiscuousCheckbox.Text = "Promiscuous";
     this.promiscuousCheckbox.UseVisualStyleBackColor = true;
     //
     // DumpToFileCheckbox
     //
     this.DumpToFileCheckbox.AutoSize = true;
     this.DumpToFileCheckbox.Location = new System.Drawing.Point(164, 6);
     this.DumpToFileCheckbox.Name = "DumpToFileCheckbox";
     this.DumpToFileCheckbox.Size = new System.Drawing.Size(85, 17);
     this.DumpToFileCheckbox.TabIndex = 8;
     this.DumpToFileCheckbox.Text = "Dump to File";
     this.DumpToFileCheckbox.UseVisualStyleBackColor = true;
     //
     // FilterTextBox
     //
     this.FilterTextBox.Location = new System.Drawing.Point(43, 17);
     this.FilterTextBox.Name = "FilterTextBox";
     this.FilterTextBox.Size = new System.Drawing.Size(115, 20);
     this.FilterTextBox.TabIndex = 7;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(4, 21);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(32, 13);
     this.label1.TabIndex = 6;
     this.label1.Text = "Filter:";
     //
     // AmberPicture
     //
     this.AmberPicture.Image = global::Terminals.Properties.Resources.amber;
     this.AmberPicture.Location = new System.Drawing.Point(381, 17);
     this.AmberPicture.Name = "AmberPicture";
     this.AmberPicture.Size = new System.Drawing.Size(24, 24);
     this.AmberPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.AmberPicture.TabIndex = 2;
     this.AmberPicture.TabStop = false;
     //
     // RedPicture
     //
     this.RedPicture.Image = global::Terminals.Properties.Resources.red;
     this.RedPicture.Location = new System.Drawing.Point(441, 17);
     this.RedPicture.Name = "RedPicture";
     this.RedPicture.Size = new System.Drawing.Size(24, 24);
     this.RedPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.RedPicture.TabIndex = 4;
     this.RedPicture.TabStop = false;
     //
     // GreenPicture
     //
     this.GreenPicture.Image = global::Terminals.Properties.Resources.green;
     this.GreenPicture.Location = new System.Drawing.Point(411, 17);
     this.GreenPicture.Name = "GreenPicture";
     this.GreenPicture.Size = new System.Drawing.Size(24, 24);
     this.GreenPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.GreenPicture.TabIndex = 5;
     this.GreenPicture.TabStop = false;
     //
     // textBox1
     //
     this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.textBox1.Location = new System.Drawing.Point(3, 3);
     this.textBox1.Multiline = true;
     this.textBox1.Name = "textBox1";
     this.textBox1.ReadOnly = true;
     this.textBox1.Size = new System.Drawing.Size(547, 301);
     this.textBox1.TabIndex = 2;
     //
     // splitContainer1
     //
     this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer1.Location = new System.Drawing.Point(0, 0);
     this.splitContainer1.Name = "splitContainer1";
     //
     // splitContainer1.Panel1
     //
     this.splitContainer1.Panel1.Controls.Add(this.propertyGrid1);
     this.splitContainer1.Panel1.Controls.Add(this.panel2);
     //
     // splitContainer1.Panel2
     //
     this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
     this.splitContainer1.Size = new System.Drawing.Size(790, 534);
     this.splitContainer1.SplitterDistance = 224;
     this.splitContainer1.SplitterWidth = 5;
     this.splitContainer1.TabIndex = 3;
     //
     // panel2
     //
     this.panel2.Controls.Add(this.comboBox1);
     this.panel2.Controls.Add(this.label2);
     this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
     this.panel2.Location = new System.Drawing.Point(0, 0);
     this.panel2.Name = "panel2";
     this.panel2.Size = new System.Drawing.Size(224, 23);
     this.panel2.TabIndex = 2;
     //
     // label2
     //
     this.label2.Dock = System.Windows.Forms.DockStyle.Left;
     this.label2.Location = new System.Drawing.Point(0, 0);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(44, 23);
     this.label2.TabIndex = 1;
     this.label2.Text = "Device:";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // splitContainer2
     //
     this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer2.Location = new System.Drawing.Point(0, 0);
     this.splitContainer2.Name = "splitContainer2";
     this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
     //
     // splitContainer2.Panel1
     //
     this.splitContainer2.Panel1.Controls.Add(this.listBox1);
     this.splitContainer2.Panel1.Controls.Add(this.panel1);
     //
     // splitContainer2.Panel2
     //
     this.splitContainer2.Panel2.Controls.Add(this.tabControl1);
     this.splitContainer2.Size = new System.Drawing.Size(561, 534);
     this.splitContainer2.SplitterDistance = 196;
     this.splitContainer2.SplitterWidth = 5;
     this.splitContainer2.TabIndex = 4;
     //
     // tabControl1
     //
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Controls.Add(this.tabPage3);
     this.tabControl1.Controls.Add(this.FilteringTabPage);
     this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tabControl1.Location = new System.Drawing.Point(0, 0);
     this.tabControl1.Name = "tabControl1";
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size = new System.Drawing.Size(561, 333);
     this.tabControl1.TabIndex = 3;
     //
     // tabPage1
     //
     this.tabPage1.Controls.Add(this.textBox1);
     this.tabPage1.Location = new System.Drawing.Point(4, 22);
     this.tabPage1.Name = "tabPage1";
     this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size = new System.Drawing.Size(553, 307);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text = "Text View";
     this.tabPage1.UseVisualStyleBackColor = true;
     //
     // tabPage2
     //
     this.tabPage2.Controls.Add(this.hexBox1);
     this.tabPage2.Location = new System.Drawing.Point(4, 22);
     this.tabPage2.Name = "tabPage2";
     this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage2.Size = new System.Drawing.Size(553, 307);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text = "Hex View";
     this.tabPage2.UseVisualStyleBackColor = true;
     //
     // tabPage3
     //
     this.tabPage3.Controls.Add(this.treeView1);
     this.tabPage3.Location = new System.Drawing.Point(4, 22);
     this.tabPage3.Name = "tabPage3";
     this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
     this.tabPage3.Size = new System.Drawing.Size(553, 307);
     this.tabPage3.TabIndex = 3;
     this.tabPage3.Text = "Header";
     this.tabPage3.UseVisualStyleBackColor = true;
     //
     // treeView1
     //
     this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.treeView1.Location = new System.Drawing.Point(3, 3);
     this.treeView1.Name = "treeView1";
     this.treeView1.Size = new System.Drawing.Size(547, 301);
     this.treeView1.TabIndex = 3;
     //
     // FilteringTabPage
     //
     this.FilteringTabPage.Controls.Add(this.webBrowser1);
     this.FilteringTabPage.Location = new System.Drawing.Point(4, 22);
     this.FilteringTabPage.Name = "FilteringTabPage";
     this.FilteringTabPage.Padding = new System.Windows.Forms.Padding(3);
     this.FilteringTabPage.Size = new System.Drawing.Size(553, 307);
     this.FilteringTabPage.TabIndex = 2;
     this.FilteringTabPage.Text = "Filtering Help";
     this.FilteringTabPage.UseVisualStyleBackColor = true;
     //
     // webBrowser1
     //
     this.webBrowser1.AllowNavigation = false;
     this.webBrowser1.AllowWebBrowserDrop = false;
     this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.webBrowser1.IsWebBrowserContextMenuEnabled = false;
     this.webBrowser1.Location = new System.Drawing.Point(3, 3);
     this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
     this.webBrowser1.Name = "webBrowser1";
     this.webBrowser1.ScriptErrorsSuppressed = true;
     this.webBrowser1.Size = new System.Drawing.Size(547, 301);
     this.webBrowser1.TabIndex = 0;
     this.webBrowser1.WebBrowserShortcutsEnabled = false;
     //
     // PacketCapture
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.splitContainer1);
     this.Name = "PacketCapture";
     this.Size = new System.Drawing.Size(790, 534);
     this.Load += new System.EventHandler(this.PacketCapture_Load);
     this.Resize += new System.EventHandler(this.PacketCapture_Resize);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.AmberPicture)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.RedPicture)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.GreenPicture)).EndInit();
     this.splitContainer1.Panel1.ResumeLayout(false);
     this.splitContainer1.Panel2.ResumeLayout(false);
     this.splitContainer1.ResumeLayout(false);
     this.panel2.ResumeLayout(false);
     this.splitContainer2.Panel1.ResumeLayout(false);
     this.splitContainer2.Panel2.ResumeLayout(false);
     this.splitContainer2.ResumeLayout(false);
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     this.tabPage1.PerformLayout();
     this.tabPage2.ResumeLayout(false);
     this.tabPage3.ResumeLayout(false);
     this.FilteringTabPage.ResumeLayout(false);
     this.ResumeLayout(false);
 }
예제 #12
0
 void loadFile()
 {
     bool eSave = false;
     pwner.SetStatus(string.Empty);
     img.Source = null;
     txtEditor.Visibility = Visibility.Collapsed;
     binEditor.Visibility = Visibility.Collapsed;
     imgPane.Visibility = Visibility.Collapsed;
     disasm.Visibility = Visibility.Collapsed;
     compi.Visibility = Visibility.Collapsed;
     iledit.Visibility = Visibility.Collapsed;
     resedit.Visibility = Visibility.Collapsed;
     nd = null;
     List<string> viewAsText = new List<string>() { "xaml", "xml" };
     List<string> viewAsImage = new List<string>() { "png", "bmp", "jpg", "ico" };
     long fl = new System.IO.FileInfo(sourcefile).Length;
     pwner.SetStatus(sourcefile, true);
     string stat = string.Format("{0:0} {1}", (fl > 1024 ? (fl / 1024) : fl), (fl > 1024 ? "Kb" : "bytes"));
     if (et == EditorType.Default)
     {
         string e = Path.GetExtension(sourcefile).Substring(1);
         if (viewAsText.Contains(e)) et = EditorType.Text;
         else if (viewAsImage.Contains(e)) et = EditorType.Image;
         else if (e == "dll") et = EditorType.Assembly;
         else et = EditorType.Binary;
     }
     switch (et)
     {
         case EditorType.Text:
             eSave = true;
             try
             {
                 tbEdit.Text = System.IO.File.ReadAllText(sourcefile, Encoding.UTF8);
             }
             catch (Exception e) { MessageBox.Show(e.Message); }
             txtEditor.Visibility = Visibility.Visible;
             break;
         case EditorType.Compiler:
             eSave = true;
             compilerCode.Text = System.IO.File.ReadAllText(sourcefile, Encoding.UTF8);
             compi.Visibility = Visibility.Visible;
             break;
         case EditorType.Image:
             BitmapImage bi = StaticBitmap.Read(sourcefile);
             img.Source = bi;
             stat = string.Format("{0:0}x{1:0}px | {2}", bi.Width, bi.Height, stat);
             imgPane.Visibility = Visibility.Visible;
             break;
         case EditorType.Assembly:
             nd = new NetDasm(this);
             nd.LoadAsm(sourcefile);
             disasm.Visibility = Visibility.Visible;
             Disassemble();
             eSave = true;
             break;
         case EditorType.Binary:
             Be.Windows.Forms.HexBox hb = new Be.Windows.Forms.HexBox() { ByteProvider = new Be.Windows.Forms.FileByteProvider(sourcefile), ByteCharConverter = new Be.Windows.Forms.DefaultByteCharConverter(), BytesPerLine = 16, UseFixedBytesPerLine = true, StringViewVisible = true, VScrollBarVisible = true };
             hb.TextChanged += delegate(object sender, EventArgs ev) { NeedsSave = true; };
             binHost.Child = hb;
             binEditor.Visibility = Visibility.Visible;
             break;
         case EditorType.Resource:
             resedit.Visibility = Visibility.Visible;
             break;
     }
     pwner.SetStatus(stat);
     CanSave = eSave;
     pwner.menu_save.IsEnabled = CanSave;
     OnFileLoaded();
 }
예제 #13
0
 private void HexEditorForm_Load(object sender, EventArgs e)
 {
     HexEditor = this.HexBox;
 }
예제 #14
0
        void loadFile()
        {
            bool eSave = false;

            pwner.SetStatus(string.Empty);
            img.Source           = null;
            txtEditor.Visibility = Visibility.Collapsed;
            binEditor.Visibility = Visibility.Collapsed;
            imgPane.Visibility   = Visibility.Collapsed;
            disasm.Visibility    = Visibility.Collapsed;
            compi.Visibility     = Visibility.Collapsed;
            iledit.Visibility    = Visibility.Collapsed;
            resedit.Visibility   = Visibility.Collapsed;
            nd = null;
            List <string> viewAsText = new List <string>()
            {
                "xaml", "xml"
            };
            List <string> viewAsImage = new List <string>()
            {
                "png", "bmp", "jpg", "ico"
            };
            long fl = new System.IO.FileInfo(sourcefile).Length;

            pwner.SetStatus(sourcefile, true);
            string stat = string.Format("{0:0} {1}", (fl > 1024 ? (fl / 1024) : fl), (fl > 1024 ? "Kb" : "bytes"));

            if (et == EditorType.Default)
            {
                string e = Path.GetExtension(sourcefile).Substring(1);
                if (viewAsText.Contains(e))
                {
                    et = EditorType.Text;
                }
                else if (viewAsImage.Contains(e))
                {
                    et = EditorType.Image;
                }
                else if (e == "dll")
                {
                    et = EditorType.Assembly;
                }
                else
                {
                    et = EditorType.Binary;
                }
            }
            switch (et)
            {
            case EditorType.Text:
                eSave = true;
                try
                {
                    tbEdit.Text = System.IO.File.ReadAllText(sourcefile, Encoding.UTF8);
                }
                catch (Exception e) { MessageBox.Show(e.Message); }
                txtEditor.Visibility = Visibility.Visible;
                break;

            case EditorType.Compiler:
                eSave             = true;
                compilerCode.Text = System.IO.File.ReadAllText(sourcefile, Encoding.UTF8);
                compi.Visibility  = Visibility.Visible;
                break;

            case EditorType.Image:
                BitmapImage bi = StaticBitmap.Read(sourcefile);
                img.Source         = bi;
                stat               = string.Format("{0:0}x{1:0}px | {2}", bi.Width, bi.Height, stat);
                imgPane.Visibility = Visibility.Visible;
                break;

            case EditorType.Assembly:
                nd = new NetDasm(this);
                nd.LoadAsm(sourcefile);
                disasm.Visibility = Visibility.Visible;
                Disassemble();
                eSave = true;
                break;

            case EditorType.Binary:
                Be.Windows.Forms.HexBox hb = new Be.Windows.Forms.HexBox()
                {
                    ByteProvider = new Be.Windows.Forms.FileByteProvider(sourcefile), ByteCharConverter = new Be.Windows.Forms.DefaultByteCharConverter(), BytesPerLine = 16, UseFixedBytesPerLine = true, StringViewVisible = true, VScrollBarVisible = true
                };
                hb.TextChanged      += delegate(object sender, EventArgs ev) { NeedsSave = true; };
                binHost.Child        = hb;
                binEditor.Visibility = Visibility.Visible;
                break;

            case EditorType.Resource:
                resedit.Visibility = Visibility.Visible;
                break;
            }
            pwner.SetStatus(stat);
            CanSave = eSave;
            pwner.menu_save.IsEnabled = CanSave;
            OnFileLoaded();
        }
예제 #15
0
 /// <summary>
 /// デザイナー サポートに必要なメソッドです。このメソッドの内容を
 /// コード エディターで変更しないでください。
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackBrowser));
     this.SplitContainer = new System.Windows.Forms.SplitContainer();
     this.m_Tree = new System.Windows.Forms.TreeView();
     this.IconList = new System.Windows.Forms.ImageList(this.components);
     this.pPlay = new System.Windows.Forms.PictureBox();
     this.PicturePanel = new System.Windows.Forms.Panel();
     this.PictureView = new System.Windows.Forms.PictureBox();
     this.TextView = new System.Windows.Forms.RichTextBox();
     this.hexBox = new Be.Windows.Forms.HexBox();
     this.StatusBar = new System.Windows.Forms.StatusStrip();
     this.Status = new System.Windows.Forms.ToolStripStatusLabel();
     this.Toolbar = new System.Windows.Forms.ToolStrip();
     this.tbExtract = new System.Windows.Forms.ToolStripButton();
     this.tbUnpack = new System.Windows.Forms.ToolStripButton();
     ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).BeginInit();
     this.SplitContainer.Panel1.SuspendLayout();
     this.SplitContainer.Panel2.SuspendLayout();
     this.SplitContainer.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pPlay)).BeginInit();
     this.PicturePanel.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.PictureView)).BeginInit();
     this.StatusBar.SuspendLayout();
     this.Toolbar.SuspendLayout();
     this.SuspendLayout();
     //
     // SplitContainer
     //
     resources.ApplyResources(this.SplitContainer, "SplitContainer");
     this.SplitContainer.Name = "SplitContainer";
     //
     // SplitContainer.Panel1
     //
     this.SplitContainer.Panel1.Controls.Add(this.m_Tree);
     //
     // SplitContainer.Panel2
     //
     resources.ApplyResources(this.SplitContainer.Panel2, "SplitContainer.Panel2");
     this.SplitContainer.Panel2.Controls.Add(this.pPlay);
     this.SplitContainer.Panel2.Controls.Add(this.PicturePanel);
     this.SplitContainer.Panel2.Controls.Add(this.TextView);
     this.SplitContainer.Panel2.Controls.Add(this.hexBox);
     //
     // m_Tree
     //
     resources.ApplyResources(this.m_Tree, "m_Tree");
     this.m_Tree.ImageList = this.IconList;
     this.m_Tree.Name = "m_Tree";
     this.m_Tree.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.m_Tree_NodeMouseDoubleClick);
     //
     // IconList
     //
     this.IconList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("IconList.ImageStream")));
     this.IconList.TransparentColor = System.Drawing.Color.Transparent;
     this.IconList.Images.SetKeyName(0, "folder.png");
     this.IconList.Images.SetKeyName(1, "binary.png");
     this.IconList.Images.SetKeyName(2, "txt.png");
     this.IconList.Images.SetKeyName(3, "xml.png");
     this.IconList.Images.SetKeyName(4, "image.png");
     this.IconList.Images.SetKeyName(5, "ttf.png");
     this.IconList.Images.SetKeyName(6, "sound.png");
     //
     // pPlay
     //
     this.pPlay.BackgroundImage = global::MabiPacker.Properties.Resources.play;
     resources.ApplyResources(this.pPlay, "pPlay");
     this.pPlay.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.pPlay.Cursor = System.Windows.Forms.Cursors.Hand;
     this.pPlay.Name = "pPlay";
     this.pPlay.TabStop = false;
     this.pPlay.Click += new System.EventHandler(this.pPlay_Click);
     //
     // PicturePanel
     //
     resources.ApplyResources(this.PicturePanel, "PicturePanel");
     this.PicturePanel.BackColor = System.Drawing.SystemColors.ControlDark;
     this.PicturePanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.PicturePanel.Controls.Add(this.PictureView);
     this.PicturePanel.Name = "PicturePanel";
     //
     // PictureView
     //
     this.PictureView.BackColor = System.Drawing.SystemColors.Control;
     this.PictureView.BackgroundImage = global::MabiPacker.Properties.Resources.bg;
     this.PictureView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     resources.ApplyResources(this.PictureView, "PictureView");
     this.PictureView.Name = "PictureView";
     this.PictureView.TabStop = false;
     //
     // TextView
     //
     this.TextView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     resources.ApplyResources(this.TextView, "TextView");
     this.TextView.Name = "TextView";
     this.TextView.ReadOnly = true;
     //
     // hexBox
     //
     resources.ApplyResources(this.hexBox, "hexBox");
     this.hexBox.LineInfoForeColor = System.Drawing.Color.Empty;
     this.hexBox.LineInfoVisible = true;
     this.hexBox.Name = "hexBox";
     this.hexBox.ReadOnly = true;
     this.hexBox.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255)))));
     this.hexBox.StringViewVisible = true;
     this.hexBox.UseFixedBytesPerLine = true;
     this.hexBox.VScrollBarVisible = true;
     //
     // StatusBar
     //
     this.StatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.Status});
     resources.ApplyResources(this.StatusBar, "StatusBar");
     this.StatusBar.Name = "StatusBar";
     //
     // Status
     //
     this.Status.Name = "Status";
     resources.ApplyResources(this.Status, "Status");
     //
     // Toolbar
     //
     this.Toolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     this.tbExtract,
     this.tbUnpack});
     resources.ApplyResources(this.Toolbar, "Toolbar");
     this.Toolbar.Name = "Toolbar";
     //
     // tbExtract
     //
     resources.ApplyResources(this.tbExtract, "tbExtract");
     this.tbExtract.Name = "tbExtract";
     this.tbExtract.Click += new System.EventHandler(this.tbExport_Click);
     //
     // tbUnpack
     //
     resources.ApplyResources(this.tbUnpack, "tbUnpack");
     this.tbUnpack.Name = "tbUnpack";
     this.tbUnpack.Click += new System.EventHandler(this.tbUnpack_Click);
     //
     // PackBrowser
     //
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     resources.ApplyResources(this, "$this");
     this.Controls.Add(this.SplitContainer);
     this.Controls.Add(this.Toolbar);
     this.Controls.Add(this.StatusBar);
     this.Name = "PackBrowser";
     this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PackBrowser_FormClosing);
     this.Shown += new System.EventHandler(this.PackBrowser_Shown);
     this.SplitContainer.Panel1.ResumeLayout(false);
     this.SplitContainer.Panel2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.SplitContainer)).EndInit();
     this.SplitContainer.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.pPlay)).EndInit();
     this.PicturePanel.ResumeLayout(false);
     this.PicturePanel.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.PictureView)).EndInit();
     this.StatusBar.ResumeLayout(false);
     this.StatusBar.PerformLayout();
     this.Toolbar.ResumeLayout(false);
     this.Toolbar.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #16
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.bSave = new System.Windows.Forms.Button();
     this.bCancel = new System.Windows.Forms.Button();
     this.tbName = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.tbFloat = new System.Windows.Forms.TextBox();
     this.tbInt = new System.Windows.Forms.TextBox();
     this.tbWord = new System.Windows.Forms.TextBox();
     this.bCFloat = new System.Windows.Forms.Button();
     this.bCInt = new System.Windows.Forms.Button();
     this.bCWord = new System.Windows.Forms.Button();
     this.cbInsert = new System.Windows.Forms.CheckBox();
     this.label2 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.tbFormID = new System.Windows.Forms.TextBox();
     this.bLookup = new System.Windows.Forms.Button();
     this.bCFormID = new System.Windows.Forms.Button();
     this.tbEDID = new System.Windows.Forms.TextBox();
     this.label5 = new System.Windows.Forms.Label();
     this.hexBox1 = new Be.Windows.Forms.HexBox();
     this.bFromFile = new System.Windows.Forms.Button();
     this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
     this.SuspendLayout();
     //
     // bSave
     //
     this.bSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.bSave.Location = new System.Drawing.Point(493, 403);
     this.bSave.Name = "bSave";
     this.bSave.Size = new System.Drawing.Size(75, 23);
     this.bSave.TabIndex = 1;
     this.bSave.Text = "Save";
     this.bSave.UseVisualStyleBackColor = true;
     this.bSave.Click += new System.EventHandler(this.bSave_Click);
     //
     // bCancel
     //
     this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.bCancel.Location = new System.Drawing.Point(412, 403);
     this.bCancel.Name = "bCancel";
     this.bCancel.Size = new System.Drawing.Size(75, 23);
     this.bCancel.TabIndex = 2;
     this.bCancel.Text = "Cancel";
     this.bCancel.UseVisualStyleBackColor = true;
     this.bCancel.Click += new System.EventHandler(this.bCancel_Click);
     //
     // tbName
     //
     this.tbName.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
     this.tbName.Location = new System.Drawing.Point(12, 12);
     this.tbName.MaxLength = 4;
     this.tbName.Name = "tbName";
     this.tbName.Size = new System.Drawing.Size(100, 20);
     this.tbName.TabIndex = 5;
     this.tbName.Leave += new System.EventHandler(this.tbName_Leave);
     this.tbName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.tbName_KeyPress);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(121, 15);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(35, 13);
     this.label1.TabIndex = 6;
     this.label1.Text = "Name";
     //
     // tbFloat
     //
     this.tbFloat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.tbFloat.Location = new System.Drawing.Point(38, 349);
     this.tbFloat.Name = "tbFloat";
     this.tbFloat.Size = new System.Drawing.Size(118, 20);
     this.tbFloat.TabIndex = 8;
     //
     // tbInt
     //
     this.tbInt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.tbInt.Location = new System.Drawing.Point(38, 375);
     this.tbInt.Name = "tbInt";
     this.tbInt.Size = new System.Drawing.Size(118, 20);
     this.tbInt.TabIndex = 9;
     //
     // tbWord
     //
     this.tbWord.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.tbWord.Location = new System.Drawing.Point(38, 401);
     this.tbWord.Name = "tbWord";
     this.tbWord.Size = new System.Drawing.Size(118, 20);
     this.tbWord.TabIndex = 10;
     //
     // bCFloat
     //
     this.bCFloat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bCFloat.Location = new System.Drawing.Point(12, 349);
     this.bCFloat.Name = "bCFloat";
     this.bCFloat.Size = new System.Drawing.Size(20, 20);
     this.bCFloat.TabIndex = 11;
     this.bCFloat.UseVisualStyleBackColor = true;
     this.bCFloat.Click += new System.EventHandler(this.bCFloat_Click);
     //
     // bCInt
     //
     this.bCInt.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bCInt.Location = new System.Drawing.Point(12, 375);
     this.bCInt.Name = "bCInt";
     this.bCInt.Size = new System.Drawing.Size(20, 20);
     this.bCInt.TabIndex = 12;
     this.bCInt.UseVisualStyleBackColor = true;
     this.bCInt.Click += new System.EventHandler(this.bCInt_Click);
     //
     // bCWord
     //
     this.bCWord.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bCWord.Location = new System.Drawing.Point(12, 401);
     this.bCWord.Name = "bCWord";
     this.bCWord.Size = new System.Drawing.Size(20, 20);
     this.bCWord.TabIndex = 13;
     this.bCWord.UseVisualStyleBackColor = true;
     this.bCWord.Click += new System.EventHandler(this.bCShort_Click);
     //
     // cbInsert
     //
     this.cbInsert.AutoSize = true;
     this.cbInsert.Location = new System.Drawing.Point(230, 14);
     this.cbInsert.Name = "cbInsert";
     this.cbInsert.Size = new System.Drawing.Size(81, 17);
     this.cbInsert.TabIndex = 14;
     this.cbInsert.Text = "Insert mode";
     this.cbInsert.UseVisualStyleBackColor = true;
     this.cbInsert.CheckedChanged += new System.EventHandler(this.cbInsert_CheckedChanged);
     //
     // label2
     //
     this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(162, 353);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(27, 13);
     this.label2.TabIndex = 15;
     this.label2.Text = "float";
     //
     // label3
     //
     this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(162, 378);
     this.label3.Name = "label3";
     this.label3.Size = new System.Drawing.Size(18, 13);
     this.label3.TabIndex = 16;
     this.label3.Text = "int";
     //
     // label4
     //
     this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(162, 404);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(30, 13);
     this.label4.TabIndex = 17;
     this.label4.Text = "short";
     //
     // tbFormID
     //
     this.tbFormID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.tbFormID.Location = new System.Drawing.Point(295, 349);
     this.tbFormID.Name = "tbFormID";
     this.tbFormID.Size = new System.Drawing.Size(90, 20);
     this.tbFormID.TabIndex = 18;
     //
     // bLookup
     //
     this.bLookup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bLookup.Location = new System.Drawing.Point(214, 375);
     this.bLookup.Name = "bLookup";
     this.bLookup.Size = new System.Drawing.Size(75, 23);
     this.bLookup.TabIndex = 19;
     this.bLookup.Text = "Look up";
     this.bLookup.UseVisualStyleBackColor = true;
     this.bLookup.Click += new System.EventHandler(this.bLookup_Click);
     //
     // bCFormID
     //
     this.bCFormID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bCFormID.Location = new System.Drawing.Point(269, 349);
     this.bCFormID.Name = "bCFormID";
     this.bCFormID.Size = new System.Drawing.Size(20, 20);
     this.bCFormID.TabIndex = 20;
     this.bCFormID.UseVisualStyleBackColor = true;
     this.bCFormID.Click += new System.EventHandler(this.bCFormID_Click);
     //
     // tbEDID
     //
     this.tbEDID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                 | System.Windows.Forms.AnchorStyles.Right)));
     this.tbEDID.Location = new System.Drawing.Point(295, 375);
     this.tbEDID.Name = "tbEDID";
     this.tbEDID.ReadOnly = true;
     this.tbEDID.Size = new System.Drawing.Size(273, 20);
     this.tbEDID.TabIndex = 21;
     //
     // label5
     //
     this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.label5.AutoSize = true;
     this.label5.Location = new System.Drawing.Point(391, 353);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(41, 13);
     this.label5.TabIndex = 22;
     this.label5.Text = "FormID";
     //
     // hexBox1
     //
     this.hexBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                 | System.Windows.Forms.AnchorStyles.Left)
                 | System.Windows.Forms.AnchorStyles.Right)));
     this.hexBox1.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.hexBox1.LineInfoForeColor = System.Drawing.Color.Empty;
     this.hexBox1.Location = new System.Drawing.Point(12, 38);
     this.hexBox1.Name = "hexBox1";
     this.hexBox1.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255)))));
     this.hexBox1.Size = new System.Drawing.Size(556, 305);
     this.hexBox1.StringViewVisible = true;
     this.hexBox1.TabIndex = 7;
     this.hexBox1.UseFixedBytesPerLine = true;
     this.hexBox1.SelectionStartChanged += new System.EventHandler(this.hexBox1_SelectionStartChanged);
     this.hexBox1.InsertActiveChanged += new System.EventHandler(this.hexBox1_InsertActiveChanged);
     //
     // bFromFile
     //
     this.bFromFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.bFromFile.Location = new System.Drawing.Point(214, 404);
     this.bFromFile.Name = "bFromFile";
     this.bFromFile.Size = new System.Drawing.Size(123, 23);
     this.bFromFile.TabIndex = 23;
     this.bFromFile.Text = "Set data from file";
     this.bFromFile.UseVisualStyleBackColor = true;
     this.bFromFile.Click += new System.EventHandler(this.bFromFile_Click);
     //
     // openFileDialog1
     //
     this.openFileDialog1.AddExtension = false;
     this.openFileDialog1.FileName = "openFileDialog1";
     this.openFileDialog1.Filter = "Any file|*.*";
     this.openFileDialog1.RestoreDirectory = true;
     this.openFileDialog1.Title = "Pick file to import";
     //
     // HexDataEdit
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(580, 438);
     this.Controls.Add(this.bFromFile);
     this.Controls.Add(this.label5);
     this.Controls.Add(this.tbEDID);
     this.Controls.Add(this.bCFormID);
     this.Controls.Add(this.bLookup);
     this.Controls.Add(this.tbFormID);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.cbInsert);
     this.Controls.Add(this.bCWord);
     this.Controls.Add(this.bCInt);
     this.Controls.Add(this.bCFloat);
     this.Controls.Add(this.tbWord);
     this.Controls.Add(this.tbInt);
     this.Controls.Add(this.tbFloat);
     this.Controls.Add(this.hexBox1);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.tbName);
     this.Controls.Add(this.bCancel);
     this.Controls.Add(this.bSave);
     this.Name = "HexDataEdit";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text = "Editing: ";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #17
0
        public StreamWindow(string backend_file, string stream_id, string stream_type)
        {
            InitializeComponent();

            _stream_type = stream_type;

            _stream_id = stream_id;

            var gridView = new GridView();

            gridView.Columns.Add(new GridViewColumn()
            {
                Header = "Packet no.", DisplayMemberBinding = new Binding("PacketNumber")
            });
            gridView.Columns.Add(new GridViewColumn()
            {
                Header = "Source", DisplayMemberBinding = new Binding("Source")
            });
            gridView.Columns.Add(new GridViewColumn()
            {
                Header = "Destination", DisplayMemberBinding = new Binding("Destination")
            });
            gridView.Columns.Add(new GridViewColumn()
            {
                Header = "Payload Length", DisplayMemberBinding = new Binding("PayloadLength")
            });

            packet_stream_view.View = gridView;

            //packet_hex_editor.ReadOnlyMode = true;

            _backend_file = backend_file;

            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();

            var hex_box = new Be.Windows.Forms.HexBox {
                Dock = System.Windows.Forms.DockStyle.Fill
            };

            host.Child = hex_box;

            Grid.SetRow(host, 1);

            _child_id = grid1.Children.Add(host);

            hex_box.ByteProvider = new Be.Windows.Forms.DynamicByteProvider(new List <byte>());
            hex_box.ReadOnly     = true;

            selected_packet_status.Content = "NO PACKET (READONLY)";

            ui_dispatcher_timer.Tick    += new EventHandler(ui_update_tick);
            ui_dispatcher_timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            ui_dispatcher_timer.Start();

            if (cGlobalState.global_intercept_flag == true)
            {
                _is_intercepting = true;

                intercept_status.Content = "Intercepting: " + (_is_intercepting == true ? "yes" : "no");

                _intercepting_client = ui_tcp_wait_for_connection();
            }
        }
예제 #18
0
 private void SetHexData(Be.Windows.Forms.HexBox HexBox, GR.Memory.ByteBuffer Data)
 {
     HexBox.ByteProvider = new Be.Windows.Forms.DynamicByteProvider(Data.Data());
 }
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.panel1 = new System.Windows.Forms.Panel();
     this.button1 = new System.Windows.Forms.Button();
     this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
     this.radioButtonDec = new System.Windows.Forms.RadioButton();
     this.radioButtonHex = new System.Windows.Forms.RadioButton();
     this.label1 = new System.Windows.Forms.Label();
     this.labelSearch = new System.Windows.Forms.Label();
     this.textBox2 = new System.Windows.Forms.TextBox();
     this.hexBox = new Be.Windows.Forms.HexBox();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
     this.SuspendLayout();
     //
     // panel1
     //
     this.panel1.Controls.Add(this.button1);
     this.panel1.Controls.Add(this.numericUpDown1);
     this.panel1.Controls.Add(this.radioButtonDec);
     this.panel1.Controls.Add(this.radioButtonHex);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.labelSearch);
     this.panel1.Controls.Add(this.textBox2);
     this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(613, 50);
     this.panel1.TabIndex = 1;
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(383, 8);
     this.button1.Name = "button1";
     this.button1.Size = new System.Drawing.Size(63, 30);
     this.button1.TabIndex = 5;
     this.button1.Text = "Refresh";
     this.button1.UseVisualStyleBackColor = true;
     this.button1.Click += new System.EventHandler(this.buttonRefresh);
     //
     // numericUpDown1
     //
     this.numericUpDown1.Location = new System.Drawing.Point(555, 15);
     this.numericUpDown1.Maximum = new decimal(new int[] {
     128,
     0,
     0,
     0});
     this.numericUpDown1.Minimum = new decimal(new int[] {
     1,
     0,
     0,
     0});
     this.numericUpDown1.Name = "numericUpDown1";
     this.numericUpDown1.Size = new System.Drawing.Size(43, 20);
     this.numericUpDown1.TabIndex = 4;
     this.numericUpDown1.Value = new decimal(new int[] {
     16,
     0,
     0,
     0});
     this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
     //
     // radioButtonDec
     //
     this.radioButtonDec.AutoSize = true;
     this.radioButtonDec.Location = new System.Drawing.Point(300, 15);
     this.radioButtonDec.Name = "radioButtonDec";
     this.radioButtonDec.Size = new System.Drawing.Size(63, 17);
     this.radioButtonDec.TabIndex = 3;
     this.radioButtonDec.Text = "Decimal";
     this.radioButtonDec.UseVisualStyleBackColor = true;
     //
     // radioButtonHex
     //
     this.radioButtonHex.AutoSize = true;
     this.radioButtonHex.Checked = true;
     this.radioButtonHex.Location = new System.Drawing.Point(250, 15);
     this.radioButtonHex.Name = "radioButtonHex";
     this.radioButtonHex.Size = new System.Drawing.Size(44, 17);
     this.radioButtonHex.TabIndex = 2;
     this.radioButtonHex.TabStop = true;
     this.radioButtonHex.Text = "Hex";
     this.radioButtonHex.UseVisualStyleBackColor = true;
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(475, 17);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(74, 13);
     this.label1.TabIndex = 1;
     this.label1.Text = "Bytes per row:";
     //
     // labelSearch
     //
     this.labelSearch.AutoSize = true;
     this.labelSearch.Location = new System.Drawing.Point(3, 17);
     this.labelSearch.Name = "labelSearch";
     this.labelSearch.Size = new System.Drawing.Size(44, 13);
     this.labelSearch.TabIndex = 1;
     this.labelSearch.Text = "Search:";
     //
     // textBox2
     //
     this.textBox2.Location = new System.Drawing.Point(63, 14);
     this.textBox2.Name = "textBox2";
     this.textBox2.Size = new System.Drawing.Size(171, 20);
     this.textBox2.TabIndex = 0;
     this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
     //
     // hexBox
     //
     //
     //
     //
     this.hexBox.BuiltInContextMenu.CopyMenuItemText = "";
     this.hexBox.BuiltInContextMenu.CutMenuItemText = "";
     this.hexBox.BuiltInContextMenu.PasteMenuItemText = "";
     this.hexBox.BuiltInContextMenu.SelectAllMenuItemText = "";
     this.hexBox.Dock = System.Windows.Forms.DockStyle.Fill;
     this.hexBox.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.hexBox.LineInfoForeColor = System.Drawing.Color.Empty;
     this.hexBox.LineInfoVisible = true;
     this.hexBox.Location = new System.Drawing.Point(0, 50);
     this.hexBox.Name = "hexBox";
     this.hexBox.ShadowSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(60)))), ((int)(((byte)(188)))), ((int)(((byte)(255)))));
     this.hexBox.Size = new System.Drawing.Size(613, 327);
     this.hexBox.StringViewVisible = true;
     this.hexBox.TabIndex = 2;
     this.hexBox.UseFixedBytesPerLine = true;
     this.hexBox.VScrollBarVisible = true;
     //
     // MemoryViewer
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.Controls.Add(this.hexBox);
     this.Controls.Add(this.panel1);
     this.Name = "MemoryViewer";
     this.Size = new System.Drawing.Size(613, 377);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
     this.ResumeLayout(false);
 }