diff --git a/Programs/GridProxy/GridProxy.cs b/Programs/GridProxy/GridProxy.cs
index 836049af..8a33911f 100644
--- a/Programs/GridProxy/GridProxy.cs
+++ b/Programs/GridProxy/GridProxy.cs
@@ -31,7 +31,7 @@
*/
// #define DEBUG_SEQUENCE
-#define DEBUG_CAPS
+// #define DEBUG_CAPS
// #define DEBUG_THREADS
using System;
diff --git a/Programs/WinGridProxy/Form1.Designer.cs b/Programs/WinGridProxy/Form1.Designer.cs
new file mode 100644
index 00000000..dfc5b737
--- /dev/null
+++ b/Programs/WinGridProxy/Form1.Designer.cs
@@ -0,0 +1,644 @@
+namespace WinGridProxy
+{
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
+ this.panelProxyConfig = new System.Windows.Forms.Panel();
+ this.textBoxLoginURL = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.textBoxProxyPort = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.textBoxProxyListenIP = new System.Windows.Forms.TextBox();
+ this.panel2 = new System.Windows.Forms.Panel();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.listViewSessions = new System.Windows.Forms.ListView();
+ this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
+ this.tabControl1 = new System.Windows.Forms.TabControl();
+ this.tabPageSummary = new System.Windows.Forms.TabPage();
+ this.label4 = new System.Windows.Forms.Label();
+ this.tabPageFilters = new System.Windows.Forms.TabPage();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.checkBox2 = new System.Windows.Forms.CheckBox();
+ this.button2 = new System.Windows.Forms.Button();
+ this.checkedListBox2 = new System.Windows.Forms.CheckedListBox();
+ this.tabPageInspect = new System.Windows.Forms.TabPage();
+ this.tabControl2 = new System.Windows.Forms.TabControl();
+ this.tabPageInspectorRAW = new System.Windows.Forms.TabPage();
+ this.richTextBoxRawLog = new System.Windows.Forms.RichTextBox();
+ this.tabPageInspectorXML = new System.Windows.Forms.TabPage();
+ this.tabPageInspectorBytes = new System.Windows.Forms.TabPage();
+ this.tabPageInspectorJSON = new System.Windows.Forms.TabPage();
+ this.tabPageInject = new System.Windows.Forms.TabPage();
+ this.richTextBox1 = new System.Windows.Forms.RichTextBox();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton();
+ this.captureTrafficToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveSessionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.loadSessionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.treeView1 = new System.Windows.Forms.TreeView();
+ this.panelProxyConfig.SuspendLayout();
+ this.panel2.SuspendLayout();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.tabControl1.SuspendLayout();
+ this.tabPageSummary.SuspendLayout();
+ this.tabPageFilters.SuspendLayout();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.groupBox1.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.tabPageInspect.SuspendLayout();
+ this.tabControl2.SuspendLayout();
+ this.tabPageInspectorRAW.SuspendLayout();
+ this.tabPageInspectorXML.SuspendLayout();
+ this.tabPageInject.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panelProxyConfig
+ //
+ this.panelProxyConfig.Controls.Add(this.textBoxLoginURL);
+ this.panelProxyConfig.Controls.Add(this.label3);
+ this.panelProxyConfig.Controls.Add(this.label2);
+ this.panelProxyConfig.Controls.Add(this.textBoxProxyPort);
+ this.panelProxyConfig.Controls.Add(this.button1);
+ this.panelProxyConfig.Controls.Add(this.label1);
+ this.panelProxyConfig.Controls.Add(this.textBoxProxyListenIP);
+ this.panelProxyConfig.Location = new System.Drawing.Point(12, 28);
+ this.panelProxyConfig.Name = "panelProxyConfig";
+ this.panelProxyConfig.Size = new System.Drawing.Size(551, 45);
+ this.panelProxyConfig.TabIndex = 0;
+ //
+ // textBoxLoginURL
+ //
+ this.textBoxLoginURL.Location = new System.Drawing.Point(215, 22);
+ this.textBoxLoginURL.Name = "textBoxLoginURL";
+ this.textBoxLoginURL.Size = new System.Drawing.Size(252, 20);
+ this.textBoxLoginURL.TabIndex = 6;
+ this.textBoxLoginURL.Text = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(212, 6);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(58, 13);
+ this.label3.TabIndex = 5;
+ this.label3.Text = "Login URL";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(3, 6);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(89, 13);
+ this.label2.TabIndex = 4;
+ this.label2.Text = "Listen IP Address";
+ //
+ // textBoxProxyPort
+ //
+ this.textBoxProxyPort.Location = new System.Drawing.Point(109, 22);
+ this.textBoxProxyPort.Name = "textBoxProxyPort";
+ this.textBoxProxyPort.Size = new System.Drawing.Size(100, 20);
+ this.textBoxProxyPort.TabIndex = 3;
+ this.textBoxProxyPort.Text = "8080";
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(473, 20);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Start Proxy";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(106, 6);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(26, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Port";
+ //
+ // textBoxProxyListenIP
+ //
+ this.textBoxProxyListenIP.Location = new System.Drawing.Point(3, 22);
+ this.textBoxProxyListenIP.Name = "textBoxProxyListenIP";
+ this.textBoxProxyListenIP.Size = new System.Drawing.Size(100, 20);
+ this.textBoxProxyListenIP.TabIndex = 0;
+ this.textBoxProxyListenIP.Text = "127.0.0.1";
+ //
+ // panel2
+ //
+ this.panel2.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.panel2.Controls.Add(this.splitContainer1);
+ this.panel2.Location = new System.Drawing.Point(12, 109);
+ this.panel2.Name = "panel2";
+ this.panel2.Size = new System.Drawing.Size(898, 388);
+ this.panel2.TabIndex = 1;
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.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.splitContainer1.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.listViewSessions);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.tabControl1);
+ this.splitContainer1.Size = new System.Drawing.Size(898, 388);
+ this.splitContainer1.SplitterDistance = 304;
+ this.splitContainer1.TabIndex = 0;
+ //
+ // listViewSessions
+ //
+ this.listViewSessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader3,
+ this.columnHeader4,
+ this.columnHeader5,
+ this.columnHeader2});
+ this.listViewSessions.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.listViewSessions.FullRowSelect = true;
+ this.listViewSessions.GridLines = true;
+ this.listViewSessions.Location = new System.Drawing.Point(0, 0);
+ this.listViewSessions.Name = "listViewSessions";
+ this.listViewSessions.Size = new System.Drawing.Size(304, 388);
+ this.listViewSessions.TabIndex = 0;
+ this.listViewSessions.UseCompatibleStateImageBehavior = false;
+ this.listViewSessions.View = System.Windows.Forms.View.Details;
+ this.listViewSessions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listViewSessions_ItemSelectionChanged);
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "#";
+ this.columnHeader1.Width = 35;
+ //
+ // columnHeader3
+ //
+ this.columnHeader3.Text = "Protocol";
+ this.columnHeader3.Width = 55;
+ //
+ // columnHeader4
+ //
+ this.columnHeader4.Text = "Packet Type";
+ this.columnHeader4.Width = 90;
+ //
+ // columnHeader5
+ //
+ this.columnHeader5.Text = "URL";
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "Bytes";
+ //
+ // tabControl1
+ //
+ this.tabControl1.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.tabControl1.Controls.Add(this.tabPageSummary);
+ this.tabControl1.Controls.Add(this.tabPageFilters);
+ this.tabControl1.Controls.Add(this.tabPageInspect);
+ this.tabControl1.Controls.Add(this.tabPageInject);
+ this.tabControl1.Location = new System.Drawing.Point(3, 3);
+ this.tabControl1.Name = "tabControl1";
+ this.tabControl1.SelectedIndex = 0;
+ this.tabControl1.Size = new System.Drawing.Size(589, 382);
+ this.tabControl1.TabIndex = 0;
+ //
+ // tabPageSummary
+ //
+ this.tabPageSummary.Controls.Add(this.label4);
+ this.tabPageSummary.Location = new System.Drawing.Point(4, 22);
+ this.tabPageSummary.Name = "tabPageSummary";
+ this.tabPageSummary.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPageSummary.Size = new System.Drawing.Size(581, 356);
+ this.tabPageSummary.TabIndex = 0;
+ this.tabPageSummary.Text = "Summary";
+ this.tabPageSummary.UseVisualStyleBackColor = true;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(26, 20);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(524, 13);
+ this.label4.TabIndex = 0;
+ this.label4.Text = "Use the Filters tab to enable/disable packets/messages to capture, use Inspector " +
+ "tab to view the packet data";
+ //
+ // tabPageFilters
+ //
+ this.tabPageFilters.Controls.Add(this.splitContainer2);
+ this.tabPageFilters.Location = new System.Drawing.Point(4, 22);
+ this.tabPageFilters.Name = "tabPageFilters";
+ this.tabPageFilters.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPageFilters.Size = new System.Drawing.Size(581, 356);
+ this.tabPageFilters.TabIndex = 1;
+ this.tabPageFilters.Text = "Filters";
+ this.tabPageFilters.UseVisualStyleBackColor = true;
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.Location = new System.Drawing.Point(3, 3);
+ this.splitContainer2.Name = "splitContainer2";
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.groupBox1);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.groupBox2);
+ this.splitContainer2.Size = new System.Drawing.Size(575, 350);
+ this.splitContainer2.SplitterDistance = 289;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // groupBox1
+ //
+ this.groupBox1.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.groupBox1.Controls.Add(this.checkBox1);
+ this.groupBox1.Controls.Add(this.checkedListBox1);
+ this.groupBox1.Location = new System.Drawing.Point(3, 3);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(280, 334);
+ this.groupBox1.TabIndex = 0;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "UDP Packets";
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Location = new System.Drawing.Point(6, 311);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(120, 17);
+ this.checkBox1.TabIndex = 1;
+ this.checkBox1.Text = "Check/Uncheck All";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // checkedListBox1
+ //
+ this.checkedListBox1.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.checkedListBox1.FormattingEnabled = true;
+ this.checkedListBox1.Location = new System.Drawing.Point(6, 19);
+ this.checkedListBox1.Name = "checkedListBox1";
+ this.checkedListBox1.Size = new System.Drawing.Size(268, 289);
+ this.checkedListBox1.TabIndex = 0;
+ this.checkedListBox1.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox1_ItemCheck);
+ //
+ // groupBox2
+ //
+ this.groupBox2.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.groupBox2.Controls.Add(this.checkBox2);
+ this.groupBox2.Controls.Add(this.button2);
+ this.groupBox2.Controls.Add(this.checkedListBox2);
+ this.groupBox2.Location = new System.Drawing.Point(3, 3);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(279, 334);
+ this.groupBox2.TabIndex = 1;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "Capabilities Messages";
+ //
+ // checkBox2
+ //
+ this.checkBox2.AutoSize = true;
+ this.checkBox2.Location = new System.Drawing.Point(6, 314);
+ this.checkBox2.Name = "checkBox2";
+ this.checkBox2.Size = new System.Drawing.Size(120, 17);
+ this.checkBox2.TabIndex = 2;
+ this.checkBox2.Text = "Check/Uncheck All";
+ this.checkBox2.UseVisualStyleBackColor = true;
+ this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBoxCheckallCaps_CheckedChanged);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(198, 311);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 1;
+ this.button2.Text = "Refresh";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.buttonRefreshCapsList_Click);
+ //
+ // checkedListBox2
+ //
+ this.checkedListBox2.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.checkedListBox2.FormattingEnabled = true;
+ this.checkedListBox2.Location = new System.Drawing.Point(6, 19);
+ this.checkedListBox2.Name = "checkedListBox2";
+ this.checkedListBox2.Size = new System.Drawing.Size(267, 289);
+ this.checkedListBox2.TabIndex = 0;
+ this.checkedListBox2.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxCaps_ItemCheck);
+ //
+ // tabPageInspect
+ //
+ this.tabPageInspect.Controls.Add(this.tabControl2);
+ this.tabPageInspect.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInspect.Name = "tabPageInspect";
+ this.tabPageInspect.Size = new System.Drawing.Size(581, 356);
+ this.tabPageInspect.TabIndex = 3;
+ this.tabPageInspect.Text = "Inspector";
+ this.tabPageInspect.UseVisualStyleBackColor = true;
+ //
+ // tabControl2
+ //
+ this.tabControl2.Controls.Add(this.tabPageInspectorRAW);
+ this.tabControl2.Controls.Add(this.tabPageInspectorXML);
+ this.tabControl2.Controls.Add(this.tabPageInspectorBytes);
+ this.tabControl2.Controls.Add(this.tabPageInspectorJSON);
+ this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tabControl2.Location = new System.Drawing.Point(0, 0);
+ this.tabControl2.Multiline = true;
+ this.tabControl2.Name = "tabControl2";
+ this.tabControl2.SelectedIndex = 0;
+ this.tabControl2.Size = new System.Drawing.Size(581, 356);
+ this.tabControl2.TabIndex = 0;
+ //
+ // tabPageInspectorRAW
+ //
+ this.tabPageInspectorRAW.Controls.Add(this.richTextBoxRawLog);
+ this.tabPageInspectorRAW.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInspectorRAW.Name = "tabPageInspectorRAW";
+ this.tabPageInspectorRAW.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPageInspectorRAW.Size = new System.Drawing.Size(573, 330);
+ this.tabPageInspectorRAW.TabIndex = 0;
+ this.tabPageInspectorRAW.Text = "RAW";
+ this.tabPageInspectorRAW.UseVisualStyleBackColor = true;
+ //
+ // richTextBoxRawLog
+ //
+ this.richTextBoxRawLog.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.richTextBoxRawLog.Location = new System.Drawing.Point(3, 3);
+ this.richTextBoxRawLog.Name = "richTextBoxRawLog";
+ this.richTextBoxRawLog.Size = new System.Drawing.Size(567, 324);
+ this.richTextBoxRawLog.TabIndex = 0;
+ this.richTextBoxRawLog.Text = "";
+ //
+ // tabPageInspectorXML
+ //
+ this.tabPageInspectorXML.Controls.Add(this.treeView1);
+ this.tabPageInspectorXML.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInspectorXML.Name = "tabPageInspectorXML";
+ this.tabPageInspectorXML.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPageInspectorXML.Size = new System.Drawing.Size(573, 330);
+ this.tabPageInspectorXML.TabIndex = 1;
+ this.tabPageInspectorXML.Text = "XML";
+ this.tabPageInspectorXML.UseVisualStyleBackColor = true;
+ //
+ // tabPageInspectorBytes
+ //
+ this.tabPageInspectorBytes.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInspectorBytes.Name = "tabPageInspectorBytes";
+ this.tabPageInspectorBytes.Size = new System.Drawing.Size(573, 330);
+ this.tabPageInspectorBytes.TabIndex = 2;
+ this.tabPageInspectorBytes.Text = "Binary";
+ this.tabPageInspectorBytes.UseVisualStyleBackColor = true;
+ //
+ // tabPageInspectorJSON
+ //
+ this.tabPageInspectorJSON.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInspectorJSON.Name = "tabPageInspectorJSON";
+ this.tabPageInspectorJSON.Size = new System.Drawing.Size(573, 330);
+ this.tabPageInspectorJSON.TabIndex = 3;
+ this.tabPageInspectorJSON.Text = "JSON";
+ this.tabPageInspectorJSON.UseVisualStyleBackColor = true;
+ //
+ // tabPageInject
+ //
+ this.tabPageInject.Controls.Add(this.richTextBox1);
+ this.tabPageInject.Location = new System.Drawing.Point(4, 22);
+ this.tabPageInject.Name = "tabPageInject";
+ this.tabPageInject.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPageInject.Size = new System.Drawing.Size(581, 356);
+ this.tabPageInject.TabIndex = 2;
+ this.tabPageInject.Text = "Inject";
+ this.tabPageInject.UseVisualStyleBackColor = true;
+ //
+ // richTextBox1
+ //
+ this.richTextBox1.Location = new System.Drawing.Point(6, 6);
+ this.richTextBox1.Name = "richTextBox1";
+ this.richTextBox1.Size = new System.Drawing.Size(569, 334);
+ this.richTextBox1.TabIndex = 0;
+ this.richTextBox1.Text = "";
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripDropDownButton1});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 0);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(922, 25);
+ this.toolStrip1.TabIndex = 2;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // toolStripDropDownButton1
+ //
+ this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.toolStripDropDownButton1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.captureTrafficToolStripMenuItem,
+ this.toolStripSeparator1,
+ this.saveSessionsToolStripMenuItem,
+ this.loadSessionsToolStripMenuItem,
+ this.toolStripSeparator2,
+ this.exitToolStripMenuItem});
+ this.toolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton1.Image")));
+ this.toolStripDropDownButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripDropDownButton1.Name = "toolStripDropDownButton1";
+ this.toolStripDropDownButton1.Size = new System.Drawing.Size(36, 22);
+ this.toolStripDropDownButton1.Text = "File";
+ //
+ // captureTrafficToolStripMenuItem
+ //
+ this.captureTrafficToolStripMenuItem.Name = "captureTrafficToolStripMenuItem";
+ this.captureTrafficToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
+ this.captureTrafficToolStripMenuItem.Text = "Capture Traffic";
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(155, 6);
+ //
+ // saveSessionsToolStripMenuItem
+ //
+ this.saveSessionsToolStripMenuItem.Name = "saveSessionsToolStripMenuItem";
+ this.saveSessionsToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
+ this.saveSessionsToolStripMenuItem.Text = "Save Sessions";
+ //
+ // loadSessionsToolStripMenuItem
+ //
+ this.loadSessionsToolStripMenuItem.Name = "loadSessionsToolStripMenuItem";
+ this.loadSessionsToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
+ this.loadSessionsToolStripMenuItem.Text = "Load Sessions";
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(155, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
+ this.exitToolStripMenuItem.Text = "Exit";
+ //
+ // treeView1
+ //
+ this.treeView1.Location = new System.Drawing.Point(6, 6);
+ this.treeView1.Name = "treeView1";
+ this.treeView1.Size = new System.Drawing.Size(561, 318);
+ this.treeView1.TabIndex = 0;
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(922, 509);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.panel2);
+ this.Controls.Add(this.panelProxyConfig);
+ this.Name = "Form1";
+ this.Text = "WinGridProxy";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
+ this.panelProxyConfig.ResumeLayout(false);
+ this.panelProxyConfig.PerformLayout();
+ this.panel2.ResumeLayout(false);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.tabControl1.ResumeLayout(false);
+ this.tabPageSummary.ResumeLayout(false);
+ this.tabPageSummary.PerformLayout();
+ this.tabPageFilters.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.ResumeLayout(false);
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.tabPageInspect.ResumeLayout(false);
+ this.tabControl2.ResumeLayout(false);
+ this.tabPageInspectorRAW.ResumeLayout(false);
+ this.tabPageInspectorXML.ResumeLayout(false);
+ this.tabPageInject.ResumeLayout(false);
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panelProxyConfig;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox textBoxProxyPort;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox textBoxProxyListenIP;
+ private System.Windows.Forms.TextBox textBoxLoginURL;
+ private System.Windows.Forms.Panel panel2;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.ListView listViewSessions;
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPageSummary;
+ private System.Windows.Forms.TabPage tabPageFilters;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.CheckedListBox checkedListBox1;
+ private System.Windows.Forms.CheckedListBox checkedListBox2;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.GroupBox groupBox2;
+ private System.Windows.Forms.TabPage tabPageInject;
+ private System.Windows.Forms.RichTextBox richTextBox1;
+ private System.Windows.Forms.CheckBox checkBox1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.CheckBox checkBox2;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader3;
+ private System.Windows.Forms.ColumnHeader columnHeader4;
+ private System.Windows.Forms.ColumnHeader columnHeader5;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton1;
+ private System.Windows.Forms.ToolStripMenuItem captureTrafficToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripMenuItem saveSessionsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem loadSessionsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.TabPage tabPageInspect;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.TabControl tabControl2;
+ private System.Windows.Forms.TabPage tabPageInspectorRAW;
+ private System.Windows.Forms.TabPage tabPageInspectorXML;
+ private System.Windows.Forms.TabPage tabPageInspectorBytes;
+ private System.Windows.Forms.TabPage tabPageInspectorJSON;
+ private System.Windows.Forms.RichTextBox richTextBoxRawLog;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TreeView treeView1;
+ }
+}
+
diff --git a/Programs/WinGridProxy/Form1.cs b/Programs/WinGridProxy/Form1.cs
new file mode 100644
index 00000000..c9e71463
--- /dev/null
+++ b/Programs/WinGridProxy/Form1.cs
@@ -0,0 +1,541 @@
+using System;
+using System.Net;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Reflection;
+using System.Threading;
+using GridProxy;
+using OpenMetaverse;
+using OpenMetaverse.Packets;
+using OpenMetaverse.StructuredData;
+using OpenMetaverse.Interfaces;
+using OpenMetaverse.Messages.Linden;
+using Nwc.XmlRpc;
+using System.Xml;
+
+namespace WinGridProxy
+{
+ public partial class Form1 : Form
+ {
+ private static bool IsProxyRunning = false;
+
+ ProxyManager proxy;
+ private Assembly openmvAssembly;
+
+ private int PacketCounter = 0;
+
+ public Form1()
+ {
+ InitializeComponent();
+ proxy = new ProxyManager();
+
+ ProxyManager.OnPacketLog += new ProxyManager.PacketLogHandler(ProxyManager_OnPacketLog);
+ ProxyManager.OnMessageLog += new ProxyManager.MessageLogHandler(ProxyManager_OnMessageLog);
+ ProxyManager.OnLoginResponse += new ProxyManager.LoginLogHandler(ProxyManager_OnLoginResponse);
+ openmvAssembly = Assembly.Load("OpenMetaverse");
+ if (openmvAssembly == null) throw new Exception("Assembly load exception");
+
+ InitProxyFilters();
+
+ }
+
+ private void InitProxyFilters()
+ {
+ Type packetTypeType = typeof(PacketType);
+ System.Reflection.MemberInfo[] packetTypes = packetTypeType.GetMembers();
+
+ for (int i = 0; i < packetTypes.Length; i++)
+ {
+ if (packetTypes[i].MemberType == System.Reflection.MemberTypes.Field
+ && packetTypes[i].DeclaringType == packetTypeType)
+ {
+
+ string name = packetTypes[i].Name;
+
+ PacketType pType;
+
+ try
+ {
+ pType = packetTypeFromName(name);
+ checkedListBox1.Items.Add(name, false);
+ }
+ catch (Exception)
+ {
+ continue;
+ }
+
+ }
+ }
+
+ }
+
+ private static PacketType packetTypeFromName(string name)
+ {
+ Type packetTypeType = typeof(PacketType);
+ System.Reflection.FieldInfo f = packetTypeType.GetField(name);
+ if (f == null) throw new ArgumentException("Bad packet type");
+
+ return (PacketType)Enum.ToObject(packetTypeType, (int)f.GetValue(packetTypeType));
+ }
+
+ void ProxyManager_OnPacketLog(Packet packet, Direction direction, IPEndPoint endpoint)
+ {
+ PacketAnalyzer_OnPacketLog(packet, direction, endpoint);
+ }
+
+
+ void ProxyManager_OnLoginResponse(object request, Direction direction)
+ {
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new MethodInvoker(delegate()
+ {
+ ProxyManager_OnLoginResponse(request, direction);
+ }));
+ }
+ else
+ {
+ PacketCounter++;
+ string dir = (request is XmlRpcRequest) ? ">>" : "<<";
+ string t = (request is XmlRpcRequest) ? "Request" : "Response";
+
+ string[] s = { PacketCounter.ToString() + " " + dir, "HTTPS", t, textBoxLoginURL.Text};
+ ListViewItem session = new ListViewItem(s);
+ session.Tag = request;
+
+ listViewSessions.Items.Add(session);
+
+ if (request is XmlRpcResponse)
+ {
+ XmlRpcResponse r = (XmlRpcResponse)request;
+ if (!r.IsFault)
+ {
+ Hashtable ht = (Hashtable)r.Value;
+ string st = String.Empty;
+
+ if (ht.ContainsKey("login"))
+ {
+ if ((string)ht["login"] == "true")
+ {
+ Console.WriteLine("Refresh");
+ buttonRefreshCapsList_Click(this, new EventArgs());
+ }
+
+ }
+
+ foreach (DictionaryEntry kvp in ht)
+ {
+ //Console.WriteLine("hash: {0} -> {1}", kvp.Key, kvp.Value);
+ }
+ }
+ }
+ }
+ }
+
+
+ void PacketAnalyzer_OnPacketLog(Packet packet, Direction direction, IPEndPoint endpoint)
+ {
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new MethodInvoker(delegate()
+ {
+ PacketAnalyzer_OnPacketLog(packet, direction, endpoint);
+ }));
+ }
+ else
+ {
+ PacketCounter++;
+ string dir = (direction == Direction.Incoming) ? "<<" : ">>";
+ string[] s = {PacketCounter.ToString() + " " + dir , "UDP", packet.Type.ToString(), endpoint.ToString(), packet.Length.ToString()};
+ ListViewItem session = new ListViewItem(s);
+ session.Tag = packet;
+
+ listViewSessions.Items.Add(session);
+ }
+ }
+
+ void ProxyManager_OnMessageLog(CapsRequest req, CapsStage stage)
+ {
+ if (this.InvokeRequired)
+ {
+ this.BeginInvoke(new MethodInvoker(delegate()
+ {
+ ProxyManager_OnMessageLog(req, stage);
+ }));
+ }
+ else
+ {
+ PacketCounter++;
+ string dir = (stage == CapsStage.Request) ? ">>" : "<<";
+ string[] s = { PacketCounter.ToString() + " " + dir, "CAPS", req.Info.CapType, req.Info.URI, "" };
+ ListViewItem session = new ListViewItem(s);
+ session.Tag = req;
+
+ listViewSessions.Items.Add(session);
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ if (button1.Text.StartsWith("Start") && IsProxyRunning.Equals(false))
+ {
+ // start the proxy
+ textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = textBoxLoginURL.Enabled = false;
+ proxy.Start();
+ IsProxyRunning = true;
+ button1.Text = "Stop Proxy";
+ }
+ else if (button1.Text.StartsWith("Stop") && IsProxyRunning.Equals(true))
+ {
+ // stop the proxy
+ proxy.Stop();
+ IsProxyRunning = false;
+ button1.Text = "Start Proxy";
+ textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = textBoxLoginURL.Enabled = true;
+ }
+ }
+
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+ for (int i = 0; i < checkedListBox1.Items.Count; i++)
+ {
+ checkedListBox1.SetItemChecked(i, checkBox1.Checked);
+ }
+ }
+
+ private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
+ {
+ //Console.WriteLine("Item {0} is now {1}", checkedListBox1.Items[e.Index], e.NewValue);
+ if (e.CurrentValue != e.NewValue)
+ {
+ proxy.AddUDPDelegate(packetTypeFromName(checkedListBox1.Items[e.Index].ToString()), (e.NewValue == CheckState.Checked));
+ }
+ }
+
+ private void buttonRefreshCapsList_Click(object sender, EventArgs e)
+ {
+ Dictionary dict = proxy.GetCapabilities();
+ foreach (KeyValuePair kvp in dict)
+ {
+ if (!checkedListBox2.Items.Contains(kvp.Value.CapType))
+ checkedListBox2.Items.Add(kvp.Value.CapType);
+ }
+ }
+
+ private void checkBoxCheckallCaps_CheckedChanged(object sender, EventArgs e)
+ {
+ for (int i = 0; i < checkedListBox2.Items.Count; i++)
+ {
+ checkedListBox2.SetItemChecked(i, checkBox2.Checked);
+ }
+ }
+
+ private void checkedListBoxCaps_ItemCheck(object sender, ItemCheckEventArgs e)
+ {
+ if (e.CurrentValue != e.NewValue)
+ {
+ proxy.AddCapsDelegate(checkedListBox2.Items[e.Index].ToString(), (e.NewValue == CheckState.Checked));
+ }
+ }
+
+ public static string PacketToString(Packet packet)
+ {
+ StringBuilder result = new StringBuilder();
+
+ foreach (FieldInfo packetField in packet.GetType().GetFields())
+ {
+ object packetDataObject = packetField.GetValue(packet);
+
+ result.AppendFormat("-- {0} --" + System.Environment.NewLine, packetField.Name);
+ result.AppendFormat("-- {0} --" + System.Environment.NewLine, packet.Type);
+ foreach (FieldInfo packetValueField in packetField.GetValue(packet).GetType().GetFields())
+ {
+ result.AppendFormat("{0}: {1}" + System.Environment.NewLine,
+ packetValueField.Name, packetValueField.GetValue(packetDataObject));
+ }
+
+ // handle blocks that are arrays
+ if (packetDataObject.GetType().IsArray)
+ {
+ foreach (object nestedArrayRecord in packetDataObject as Array)
+ {
+ foreach (FieldInfo packetArrayField in nestedArrayRecord.GetType().GetFields())
+ {
+ result.AppendFormat("{0} {1}" + System.Environment.NewLine,
+ packetArrayField.Name, packetArrayField.GetValue(nestedArrayRecord));
+ }
+ }
+ }
+ else
+ {
+ // handle non array data blocks
+ foreach (PropertyInfo packetPropertyField in packetField.GetValue(packet).GetType().GetProperties())
+ {
+ // Handle fields named "Data" specifically, this is generally binary data, we'll display it as hex values
+ if (packetPropertyField.PropertyType.Equals(typeof(System.Byte[]))
+ && packetPropertyField.Name.Equals("Data"))
+ {
+ result.AppendFormat("{0}: {1}" + System.Environment.NewLine,
+ packetPropertyField.Name,
+ Utils.BytesToHexString((byte[])packetPropertyField.GetValue(packetDataObject, null), packetPropertyField.Name));
+ }
+ // decode bytes into strings
+ else if (packetPropertyField.PropertyType.Equals(typeof(System.Byte[])))
+ {
+ result.AppendFormat("{0}: {1}" + System.Environment.NewLine,
+ packetPropertyField.Name,
+ Utils.BytesToString((byte[])packetPropertyField.GetValue(packetDataObject, null)));
+ }
+ else
+ {
+ result.AppendFormat("{0}: {1}" + System.Environment.NewLine,
+ packetPropertyField.Name, packetPropertyField.GetValue(packetDataObject, null));
+ }
+ }
+ }
+ }
+ return result.ToString();
+ }
+
+ private void listViewSessions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
+ {
+ if (e.IsSelected)
+ {
+ object t = e.Item.Tag;
+
+ if (t is XmlRpcRequest)
+ {
+ Console.WriteLine("XmlRpcRequest");
+ XmlRpcRequest r = (XmlRpcRequest)t;
+
+ richTextBoxRawLog.Text = r.ToString();
+ }
+ else if (t is XmlRpcResponse)
+ {
+ Console.WriteLine("XmlRpcResponse");
+ XmlRpcResponse r = (XmlRpcResponse)t;
+ Hashtable tbl = (Hashtable)r.Value;
+ richTextBoxRawLog.Text = "";
+ foreach (DictionaryEntry kvp in tbl)
+ {
+ richTextBoxRawLog.AppendText(String.Format("{0}={1}" + System.Environment.NewLine, kvp.Key, kvp.Value));
+ }
+ }
+ else if (t is Packet)
+ {
+ Console.WriteLine("Packet");
+ richTextBoxRawLog.Text = PacketToString((Packet)t);
+ }
+ else if (t is CapsRequest)
+ {
+ Console.WriteLine("CAPS");
+ CapsRequest obj = (CapsRequest)t;
+ Console.WriteLine(t.ToString());
+ if (obj.Response != null)
+ {
+ richTextBoxRawLog.Text = obj.Response.ToString();
+ treeView1.Nodes.Add(OSDParser.SerializeLLSDXmlString(obj.Response));
+ //XmlToTree(OSDParser.SerializeLLSDXmlString(obj.Response), treeView1);
+ }
+ else
+ richTextBoxRawLog.Text = "No Message Data";
+ }
+ else
+ {
+ richTextBoxRawLog.Text = String.Format("Unknown packet/message: {0}:{1}" + System.Environment.NewLine, e.Item.Text, t.GetType());
+ }
+ }
+ }
+
+ //private void XmlToTree(string xml, TreeView tree)
+ //{
+ // try
+ // {
+ // //this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
+
+
+
+ // // Load the XML file.
+ // XmlDocument dom = new XmlDocument();
+ // dom.Load(" " + xml);
+
+ // // Load the XML into the TreeView.
+ // treeView1.Nodes.Clear();
+ // treeView1.Nodes.Add(new TreeNode(strRootNode));
+ // // SECTION 2. Initialize the TreeView control.
+ // treeView1.Nodes.Clear();
+ // treeView1.Nodes.Add(new TreeNode(dom.DocumentElement.Name));
+ // TreeNode tNode = new TreeNode();
+ // tNode = treeView1.Nodes[0];
+
+ // // SECTION 3. Populate the TreeView with the DOM nodes.
+ // AddNode(dom.DocumentElement, tNode);
+ // treeView1.ExpandAll();
+
+ // //this.Cursor = System.Windows.Forms.Cursors.Default;
+ // }
+
+ // catch (Exception ex)
+ // {
+ // this.Cursor = System.Windows.Forms.Cursors.Default;
+ // MessageBox.Show(ex.Message, "Error");
+ // }
+
+ //}
+
+ private void AddNode(XmlNode inXmlNode, TreeNode inTreeNode)
+ {
+ XmlNode xNode;
+ TreeNode tNode;
+ XmlNodeList nodeList;
+ int i;
+
+ // Loop through the XML nodes until the leaf is reached.
+ // Add the nodes to the TreeView during the looping process.
+ if (inXmlNode.HasChildNodes)
+ {
+ nodeList = inXmlNode.ChildNodes;
+ for (i = 0; i <= nodeList.Count - 1; i++)
+ {
+ xNode = inXmlNode.ChildNodes[i];
+ inTreeNode.Nodes.Add(new TreeNode(xNode.Name));
+ tNode = inTreeNode.Nodes[i];
+ AddNode(xNode, tNode);
+ }
+ }
+ else
+ {
+ // Here you need to pull the data from the XmlNode based on the
+ // type of node, whether attribute values are required, and so forth.
+ inTreeNode.Text = (inXmlNode.OuterXml).Trim();
+ }
+ }
+
+
+ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (IsProxyRunning)
+ proxy.Stop();
+ }
+ }
+
+ public class ProxyManager
+ {
+ public delegate void PacketLogHandler(Packet packet, Direction direction, IPEndPoint endpoint);
+ public static event PacketLogHandler OnPacketLog;
+
+ public delegate void MessageLogHandler(CapsRequest req, CapsStage stage);
+ public static event MessageLogHandler OnMessageLog;
+
+ public delegate void LoginLogHandler(object request, Direction direction);
+ public static event LoginLogHandler OnLoginResponse;
+
+ ProxyFrame Proxy;
+ ProxyPlugin analyst;
+ public ProxyManager()
+ {
+ string[] args = {};
+ Proxy = new ProxyFrame(args);
+
+ analyst = new PacketAnalyzer(Proxy);
+ analyst.Init();
+
+ Proxy.proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
+ Proxy.proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));
+
+ AddCapsDelegate("SeedCapability", true);
+ }
+
+ public void Start()
+ {
+
+ Proxy.proxy.Start();
+ }
+
+ public void Stop()
+ {
+ Proxy.proxy.Stop();
+ }
+
+ private void LoginRequest(XmlRpcRequest request)
+ {
+ if (OnLoginResponse != null)
+ OnLoginResponse(request, Direction.Outgoing);
+ }
+
+ private void LoginResponse(XmlRpcResponse response)
+ {
+ if (OnLoginResponse != null)
+ OnLoginResponse(response, Direction.Incoming);
+ }
+
+
+ internal Dictionary GetCapabilities()
+ {
+ return Proxy.proxy.KnownCaps;
+ }
+
+ internal void AddCapsDelegate(string capsKey, bool add)
+ {
+ if (add)
+ Proxy.proxy.AddCapsDelegate(capsKey, new CapsDelegate(CapsHandler));
+ else
+ Proxy.proxy.RemoveCapRequestDelegate(capsKey, new CapsDelegate(CapsHandler));
+
+ }
+
+ private bool CapsHandler(CapsRequest req, CapsStage stage)
+ {
+ if (OnMessageLog != null)
+ OnMessageLog(req, stage);
+ //Console.WriteLine(req);
+ return false;
+ }
+
+ internal void AddUDPDelegate(PacketType packetType, bool add)
+ {
+ if (add)
+ {
+ Proxy.proxy.AddDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketHandler));
+ Proxy.proxy.AddDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketHandler));
+ }
+ else
+ {
+ Proxy.proxy.RemoveDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketHandler));
+ Proxy.proxy.RemoveDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketHandler));
+ }
+ }
+
+ private Packet PacketHandler(Packet packet, IPEndPoint endPoint)
+ {
+ if(OnPacketLog != null)
+ OnPacketLog(packet, Direction.Incoming, endPoint);
+
+ return packet;
+ }
+
+
+ }
+
+ public class PacketAnalyzer : ProxyPlugin
+ {
+ private ProxyFrame frame;
+ private Proxy proxy;
+
+ public PacketAnalyzer(ProxyFrame frame)
+ {
+ this.frame = frame;
+ this.proxy = frame.proxy;
+ }
+
+ public override void Init()
+ {
+
+ }
+ }
+}
diff --git a/Programs/WinGridProxy/Form1.resx b/Programs/WinGridProxy/Form1.resx
new file mode 100644
index 00000000..97685db4
--- /dev/null
+++ b/Programs/WinGridProxy/Form1.resx
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
+ U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
+ VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
+ QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
+ /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
+ cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
+ 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
+ dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
+ NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
+ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
+
+
+
\ No newline at end of file
diff --git a/Programs/WinGridProxy/Program.cs b/Programs/WinGridProxy/Program.cs
new file mode 100644
index 00000000..e0cd4a68
--- /dev/null
+++ b/Programs/WinGridProxy/Program.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace WinGridProxy
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
diff --git a/Programs/WinGridProxy/Properties/AssemblyInfo.cs b/Programs/WinGridProxy/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..9ce0de1c
--- /dev/null
+++ b/Programs/WinGridProxy/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WinGridProxy")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WinGridProxy")]
+[assembly: AssemblyCopyright("Copyright © 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("25d093d1-bd9c-4734-ba59-399a72efcaf2")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Programs/WinGridProxy/Properties/Resources.Designer.cs b/Programs/WinGridProxy/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..33d17394
--- /dev/null
+++ b/Programs/WinGridProxy/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3082
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WinGridProxy.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinGridProxy.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Programs/WinGridProxy/Properties/Resources.resx b/Programs/WinGridProxy/Properties/Resources.resx
new file mode 100644
index 00000000..ffecec85
--- /dev/null
+++ b/Programs/WinGridProxy/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Programs/WinGridProxy/Properties/Settings.Designer.cs b/Programs/WinGridProxy/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..2d9e7a02
--- /dev/null
+++ b/Programs/WinGridProxy/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3082
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WinGridProxy.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Programs/WinGridProxy/Properties/Settings.settings b/Programs/WinGridProxy/Properties/Settings.settings
new file mode 100644
index 00000000..abf36c5d
--- /dev/null
+++ b/Programs/WinGridProxy/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/prebuild.xml b/prebuild.xml
index 47da12e5..2fdb503e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -602,6 +602,37 @@
+
+
+
+
+ ../../bin/
+
+
+
+
+ ../../bin/
+
+
+
+ ../../bin/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+