diff --git a/EndlessClient.sln b/EndlessClient.sln index 92d5d434c..e034dff40 100644 --- a/EndlessClient.sln +++ b/EndlessClient.sln @@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib", "EOLib\EOLib.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Config", "EOLib.Config\EOLib.Config.csproj", "{B6AD3196-D307-4352-9979-9237CB08B102}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOLib.Graphics", "EOLib.Graphics\EOLib.Graphics.csproj", "{8C4BC247-89ED-4629-B34B-15A5AEE88E2D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Graphics", "EOLib.Graphics\EOLib.Graphics.csproj", "{8C4BC247-89ED-4629-B34B-15A5AEE88E2D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.IO", "EOLib.IO\EOLib.IO.csproj", "{51B93DB4-896E-497F-A56E-F7BE47CF0170}" EndProject @@ -23,7 +23,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Logger", "EOLib.Logge EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Config.Test", "EOLib.Config.Test\EOLib.Config.Test.csproj", "{12BC6C2E-CEB1-4943-9843-AB4606658376}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOLib.Graphics.Test", "EOLib.Graphics.Test\EOLib.Graphics.Test.csproj", "{2A903DEF-46C6-4E67-A039-A1561DB26C53}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Graphics.Test", "EOLib.Graphics.Test\EOLib.Graphics.Test.csproj", "{2A903DEF-46C6-4E67-A039-A1561DB26C53}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.IO.Test", "EOLib.IO.Test\EOLib.IO.Test.csproj", "{FF9D8961-6E65-4B87-82FA-1C920CA9D37F}" EndProject @@ -31,15 +31,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Localization.Test", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOLib.Test", "EOLib.Test\EOLib.Test.csproj", "{A55498F8-78C2-4760-AA2C-429D39F35BB8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatchMap", "BatchMap\BatchMap.csproj", "{09B4B9F7-64AF-4E6A-AAE1-52C41201179A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BatchMap", "BatchMap\BatchMap.csproj", "{09B4B9F7-64AF-4E6A-AAE1-52C41201179A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BatchPub", "BatchPub\BatchPub.csproj", "{18DC9959-1C79-4956-9FD1-438B9D445439}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BatchPub", "BatchPub\BatchPub.csproj", "{18DC9959-1C79-4956-9FD1-438B9D445439}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOBot", "EOBot\EOBot.csproj", "{1061D316-7F0B-4BD5-9821-A8FF7DE32F6E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PacketDecoder", "PacketDecoder\PacketDecoder.csproj", "{D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndlessClient", "EndlessClient\EndlessClient.csproj", "{0EC2FDA3-00E9-4DF4-8743-85E2C911E6E8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EndlessClient", "EndlessClient\EndlessClient.csproj", "{0EC2FDA3-00E9-4DF4-8743-85E2C911E6E8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -103,10 +101,6 @@ Global {1061D316-7F0B-4BD5-9821-A8FF7DE32F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU {1061D316-7F0B-4BD5-9821-A8FF7DE32F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU {1061D316-7F0B-4BD5-9821-A8FF7DE32F6E}.Release|Any CPU.Build.0 = Release|Any CPU - {D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14}.Release|Any CPU.Build.0 = Release|Any CPU {0EC2FDA3-00E9-4DF4-8743-85E2C911E6E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0EC2FDA3-00E9-4DF4-8743-85E2C911E6E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {0EC2FDA3-00E9-4DF4-8743-85E2C911E6E8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -130,7 +124,6 @@ Global {09B4B9F7-64AF-4E6A-AAE1-52C41201179A} = {795A3BFF-4306-456D-86AB-6A680A2B7C0B} {18DC9959-1C79-4956-9FD1-438B9D445439} = {795A3BFF-4306-456D-86AB-6A680A2B7C0B} {1061D316-7F0B-4BD5-9821-A8FF7DE32F6E} = {795A3BFF-4306-456D-86AB-6A680A2B7C0B} - {D6D15D36-E7F3-4A08-9A3D-6AA382D0DE14} = {795A3BFF-4306-456D-86AB-6A680A2B7C0B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CED36352-F489-4071-A4F8-51FC08795DC7} diff --git a/PacketDecoder/MainForm.Designer.cs b/PacketDecoder/MainForm.Designer.cs deleted file mode 100644 index d87cadfc7..000000000 --- a/PacketDecoder/MainForm.Designer.cs +++ /dev/null @@ -1,349 +0,0 @@ -namespace PacketDecoder -{ - partial class MainForm - { - /// - /// 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() - { - this.txtEMulti = new System.Windows.Forms.TextBox(); - this.grpMultiples = new System.Windows.Forms.GroupBox(); - this.label2 = new System.Windows.Forms.Label(); - this.txtDMulti = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); - this.grpData = new System.Windows.Forms.GroupBox(); - this.label4 = new System.Windows.Forms.Label(); - this.txtOffset = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.txtLength = new System.Windows.Forms.TextBox(); - this.grpInput = new System.Windows.Forms.GroupBox(); - this.txtInputData = new System.Windows.Forms.TextBox(); - this.grpOutput = new System.Windows.Forms.GroupBox(); - this.lblAction = new System.Windows.Forms.Label(); - this.lblFamily = new System.Windows.Forms.Label(); - this.lblPacketLength = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.txtDecoded = new System.Windows.Forms.TextBox(); - this.txtOutput = new System.Windows.Forms.TextBox(); - this.label6 = new System.Windows.Forms.Label(); - this.cmbOutputFmt = new System.Windows.Forms.ComboBox(); - this.label5 = new System.Windows.Forms.Label(); - this.btnImportMultis = new System.Windows.Forms.Button(); - this.grpMultiples.SuspendLayout(); - this.grpData.SuspendLayout(); - this.grpInput.SuspendLayout(); - this.grpOutput.SuspendLayout(); - this.SuspendLayout(); - // - // txtEMulti - // - this.txtEMulti.Location = new System.Drawing.Point(69, 19); - this.txtEMulti.Name = "txtEMulti"; - this.txtEMulti.Size = new System.Drawing.Size(43, 20); - this.txtEMulti.TabIndex = 1; - this.txtEMulti.Leave += new System.EventHandler(this.intTextValidate); - // - // grpMultiples - // - this.grpMultiples.Controls.Add(this.label2); - this.grpMultiples.Controls.Add(this.txtDMulti); - this.grpMultiples.Controls.Add(this.label1); - this.grpMultiples.Controls.Add(this.txtEMulti); - this.grpMultiples.Location = new System.Drawing.Point(12, 12); - this.grpMultiples.Name = "grpMultiples"; - this.grpMultiples.Size = new System.Drawing.Size(123, 74); - this.grpMultiples.TabIndex = 0; - this.grpMultiples.TabStop = false; - this.grpMultiples.Text = "Multiples"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 48); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(58, 13); - this.label2.TabIndex = 2; - this.label2.Text = "Decryption"; - // - // txtDMulti - // - this.txtDMulti.Location = new System.Drawing.Point(69, 45); - this.txtDMulti.Name = "txtDMulti"; - this.txtDMulti.Size = new System.Drawing.Size(43, 20); - this.txtDMulti.TabIndex = 3; - this.txtDMulti.Leave += new System.EventHandler(this.intTextValidate); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 22); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(57, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Encryption"; - // - // grpData - // - this.grpData.Controls.Add(this.label4); - this.grpData.Controls.Add(this.txtOffset); - this.grpData.Location = new System.Drawing.Point(141, 12); - this.grpData.Name = "grpData"; - this.grpData.Size = new System.Drawing.Size(123, 50); - this.grpData.TabIndex = 1; - this.grpData.TabStop = false; - this.grpData.Text = "Data"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(6, 22); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(35, 13); - this.label4.TabIndex = 0; - this.label4.Text = "Offset"; - // - // txtOffset - // - this.txtOffset.Location = new System.Drawing.Point(69, 19); - this.txtOffset.Name = "txtOffset"; - this.txtOffset.Size = new System.Drawing.Size(43, 20); - this.txtOffset.TabIndex = 1; - this.txtOffset.Leave += new System.EventHandler(this.intTextValidate); - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(157, 22); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(40, 13); - this.label3.TabIndex = 3; - this.label3.Text = "Length"; - // - // txtLength - // - this.txtLength.Enabled = false; - this.txtLength.Location = new System.Drawing.Point(203, 19); - this.txtLength.Name = "txtLength"; - this.txtLength.Size = new System.Drawing.Size(43, 20); - this.txtLength.TabIndex = 4; - this.txtLength.TextChanged += new System.EventHandler(this.intTextValidate); - this.txtLength.Leave += new System.EventHandler(this.intTextValidate); - // - // grpInput - // - this.grpInput.Controls.Add(this.txtInputData); - this.grpInput.Location = new System.Drawing.Point(12, 92); - this.grpInput.Name = "grpInput"; - this.grpInput.Size = new System.Drawing.Size(252, 100); - this.grpInput.TabIndex = 2; - this.grpInput.TabStop = false; - this.grpInput.Text = "Packet Data"; - // - // txtInputData - // - this.txtInputData.Location = new System.Drawing.Point(6, 19); - this.txtInputData.Multiline = true; - this.txtInputData.Name = "txtInputData"; - this.txtInputData.Size = new System.Drawing.Size(240, 75); - this.txtInputData.TabIndex = 0; - // - // grpOutput - // - this.grpOutput.Controls.Add(this.lblAction); - this.grpOutput.Controls.Add(this.lblFamily); - this.grpOutput.Controls.Add(this.lblPacketLength); - this.grpOutput.Controls.Add(this.label7); - this.grpOutput.Controls.Add(this.txtDecoded); - this.grpOutput.Controls.Add(this.txtLength); - this.grpOutput.Controls.Add(this.label3); - this.grpOutput.Controls.Add(this.txtOutput); - this.grpOutput.Controls.Add(this.label6); - this.grpOutput.Controls.Add(this.cmbOutputFmt); - this.grpOutput.Controls.Add(this.label5); - this.grpOutput.Location = new System.Drawing.Point(12, 198); - this.grpOutput.Name = "grpOutput"; - this.grpOutput.Size = new System.Drawing.Size(252, 292); - this.grpOutput.TabIndex = 3; - this.grpOutput.TabStop = false; - this.grpOutput.Text = "Output"; - // - // lblAction - // - this.lblAction.AutoSize = true; - this.lblAction.Location = new System.Drawing.Point(126, 75); - this.lblAction.Name = "lblAction"; - this.lblAction.Size = new System.Drawing.Size(43, 13); - this.lblAction.TabIndex = 9; - this.lblAction.Text = "Action: "; - // - // lblFamily - // - this.lblFamily.AutoSize = true; - this.lblFamily.Location = new System.Drawing.Point(7, 75); - this.lblFamily.Name = "lblFamily"; - this.lblFamily.Size = new System.Drawing.Size(42, 13); - this.lblFamily.TabIndex = 8; - this.lblFamily.Text = "Family: "; - // - // lblPacketLength - // - this.lblPacketLength.AutoSize = true; - this.lblPacketLength.Location = new System.Drawing.Point(7, 48); - this.lblPacketLength.Name = "lblPacketLength"; - this.lblPacketLength.Size = new System.Drawing.Size(83, 13); - this.lblPacketLength.TabIndex = 7; - this.lblPacketLength.Text = "Packet Length: "; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(7, 161); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(88, 13); - this.label7.TabIndex = 6; - this.label7.Text = "Decoded Packet"; - // - // txtDecoded - // - this.txtDecoded.HideSelection = false; - this.txtDecoded.Location = new System.Drawing.Point(6, 177); - this.txtDecoded.Multiline = true; - this.txtDecoded.Name = "txtDecoded"; - this.txtDecoded.ReadOnly = true; - this.txtDecoded.Size = new System.Drawing.Size(240, 109); - this.txtDecoded.TabIndex = 1; - // - // txtOutput - // - this.txtOutput.Location = new System.Drawing.Point(50, 101); - this.txtOutput.Multiline = true; - this.txtOutput.Name = "txtOutput"; - this.txtOutput.ReadOnly = true; - this.txtOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtOutput.Size = new System.Drawing.Size(196, 57); - this.txtOutput.TabIndex = 5; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(7, 104); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(37, 13); - this.label6.TabIndex = 1; - this.label6.Text = "Result"; - // - // cmbOutputFmt - // - this.cmbOutputFmt.FormattingEnabled = true; - this.cmbOutputFmt.Items.AddRange(new object[] { - "PacketFamily", - "PacketAction", - "Byte", - "Char", - "Short", - "Three", - "Int", - "BreakString", - "EndString", - "FixedString"}); - this.cmbOutputFmt.Location = new System.Drawing.Point(52, 19); - this.cmbOutputFmt.Name = "cmbOutputFmt"; - this.cmbOutputFmt.Size = new System.Drawing.Size(99, 21); - this.cmbOutputFmt.TabIndex = 2; - this.cmbOutputFmt.SelectedIndexChanged += new System.EventHandler(this.cmbOutputFmt_SelectedIndexChanged); - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(7, 22); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(39, 13); - this.label5.TabIndex = 0; - this.label5.Text = "Format"; - // - // btnImportMultis - // - this.btnImportMultis.Location = new System.Drawing.Point(141, 68); - this.btnImportMultis.Name = "btnImportMultis"; - this.btnImportMultis.Size = new System.Drawing.Size(123, 23); - this.btnImportMultis.TabIndex = 4; - this.btnImportMultis.Text = "Import Multiples"; - this.btnImportMultis.UseVisualStyleBackColor = true; - this.btnImportMultis.Click += new System.EventHandler(this.btnImportMultis_Click); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(275, 502); - this.Controls.Add(this.btnImportMultis); - this.Controls.Add(this.grpOutput); - this.Controls.Add(this.grpInput); - this.Controls.Add(this.grpData); - this.Controls.Add(this.grpMultiples); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.Name = "MainForm"; - this.Text = "EO Packet Decoder"; - this.grpMultiples.ResumeLayout(false); - this.grpMultiples.PerformLayout(); - this.grpData.ResumeLayout(false); - this.grpData.PerformLayout(); - this.grpInput.ResumeLayout(false); - this.grpInput.PerformLayout(); - this.grpOutput.ResumeLayout(false); - this.grpOutput.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TextBox txtEMulti; - private System.Windows.Forms.GroupBox grpMultiples; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox txtDMulti; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.GroupBox grpData; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox txtLength; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox txtOffset; - private System.Windows.Forms.GroupBox grpInput; - private System.Windows.Forms.TextBox txtInputData; - private System.Windows.Forms.GroupBox grpOutput; - private System.Windows.Forms.TextBox txtOutput; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.ComboBox cmbOutputFmt; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox txtDecoded; - private System.Windows.Forms.Label lblPacketLength; - private System.Windows.Forms.Label lblAction; - private System.Windows.Forms.Label lblFamily; - private System.Windows.Forms.Button btnImportMultis; - } -} - diff --git a/PacketDecoder/MainForm.cs b/PacketDecoder/MainForm.cs deleted file mode 100644 index d2a79918d..000000000 --- a/PacketDecoder/MainForm.cs +++ /dev/null @@ -1,280 +0,0 @@ -using System; -using System.Drawing; -using System.IO; -using System.Windows.Forms; -using EOLib.Config; -using EOLib.IO.Services; -using EOLib.Logger; -using EOLib.Net; -using EOLib.Net.PacketProcessing; - -namespace PacketDecoder -{ - public partial class MainForm : Form - { - private enum DataTypes - { - None = -1, - PacketFamily, - PacketAction, - Byte, - Char, - Short, - Three, - Int, - BreakString, - EndString, - FixedString, - } - - private DataTypes m_type; - private readonly IPacketProcessActions _packetProcessActions; - private readonly IPacketEncoderRepository _packetEncoderRepository; - private int m_packetOffset, m_dataLength; - private bool m_suppressEvent; - - public MainForm() - { - InitializeComponent(); - - cmbOutputFmt_SelectedIndexChanged(null, null); - - _packetEncoderRepository = new PacketEncoderRepository(); - _packetProcessActions = new PacketProcessActions(new SequenceRepository(), - _packetEncoderRepository, - new PacketEncoderService(new NumberEncoderService(), new DataEncoderService()), - new PacketSequenceService(), - new LoggerProvider(new LoggerFactory(new ConfigurationRepository()))); - } - - private void cmbOutputFmt_SelectedIndexChanged(object sender, EventArgs e) - { - m_type = (DataTypes) cmbOutputFmt.SelectedIndex; - if (m_type == DataTypes.FixedString) - { - txtLength.Enabled = true; - txtLength.Text = ""; - } - else - { - txtLength.Enabled = false; - switch (m_type) - { - case DataTypes.BreakString: - case DataTypes.EndString: - case DataTypes.None: - txtLength.Text = ""; - break; - case DataTypes.PacketFamily: - txtLength.Text = "1"; - break; - case DataTypes.PacketAction: - txtLength.Text = "1"; - break; - case DataTypes.Byte: - txtLength.Text = "1"; - break; - case DataTypes.Char: - txtLength.Text = "1"; - break; - case DataTypes.Short: - txtLength.Text = "2"; - break; - case DataTypes.Three: - txtLength.Text = "3"; - break; - case DataTypes.Int: - txtLength.Text = "4"; - break; - } - } - _checkRequiredInputs(); - } - - private void intTextValidate(object sender, EventArgs e) - { - if (m_suppressEvent) return; - - TextBox txt = sender as TextBox; - if (txt == null) - return; - - int param; - if (!int.TryParse(txt.Text, out param)) - { - if (txt == txtLength) - m_dataLength = 0; - return; - } - - if (txt == txtDMulti) - { - _packetProcessActions.SetEncodeMultiples(param, _packetEncoderRepository.SendMultiplier); - if (param < 6 || param > 12) - { - txtDMulti.BackColor = Color.FromArgb(255, 255, 128, 128); - } - else - { - txtDMulti.BackColor = Color.White; - } - } - else if (txt == txtEMulti) - { - _packetProcessActions.SetEncodeMultiples(_packetEncoderRepository.ReceiveMultiplier, param); - if (param < 6 || param > 12) - { - txtEMulti.BackColor = Color.FromArgb(255, 255, 128, 128); - } - else - { - txtEMulti.BackColor = Color.White; - } - } - else if (txt == txtOffset) - { - m_packetOffset = param; - if (param >= txtInputData.TextLength) - param = txtInputData.TextLength - 1; - } - else if (txt == txtLength) - m_dataLength = param; - - _checkRequiredInputs(); - } - - private void _checkRequiredInputs() - { - txtOutput.Text = ""; - - if (txtDMulti.TextLength == 0 || txtEMulti.TextLength == 0 || txtOffset.TextLength == 0) - return; - - if (txtLength.TextLength == 0 && m_type == DataTypes.FixedString) - return; - - string inputData = txtInputData.Text; - if (inputData.Length == 0) - return; - - //input data is copied from wireshark. colon delimited. - string bytes = inputData.Replace(":", ""); - string len = bytes.Substring(0, 4);//first 2 bytes are the length! - bytes = bytes.Substring(4); - byte[] data = new byte[bytes.Length / 2]; - - byte[] lenDat = new byte[2]; - for (int i = 0; i < len.Length; i += 2) - { - lenDat[i/2] = Convert.ToByte(len.Substring(i, 2), 16); - } - lblPacketLength.Text = "Packet Length: " + new NumberEncoderService().DecodeNumber(lenDat).ToString(); - - for (int i = 0; i < bytes.Length; i += 2) - { - data[i/2] = Convert.ToByte(bytes.Substring(i, 2), 16); - } - - var pkt = _packetProcessActions.DecodeData(data); - pkt.Seek(m_packetOffset, SeekOrigin.Begin); - - lblFamily.Text = pkt.Family.ToString(); - lblAction.Text = pkt.Action.ToString(); - - string decoded = ""; - for (int i = 0; i < pkt.Length; i++) - { - decoded += $"{pkt.RawData[i].ToString("D3")} "; - } - txtDecoded.Text = decoded; - - switch ((DataTypes) cmbOutputFmt.SelectedIndex) - { - case DataTypes.None: - txtOutput.Text = pkt.ReadEndString(); - break; - case DataTypes.PacketFamily: - txtOutput.Text = ((PacketFamily) pkt.PeekByte()).ToString(); - break; - case DataTypes.PacketAction: - txtOutput.Text = ((PacketAction)pkt.PeekByte()).ToString(); - break; - case DataTypes.Byte: - txtOutput.Text = pkt.PeekByte().ToString(); - break; - case DataTypes.Char: - txtOutput.Text = pkt.PeekChar().ToString(); - break; - case DataTypes.Short: - txtOutput.Text = pkt.PeekShort().ToString(); - break; - case DataTypes.Three: - txtOutput.Text = pkt.PeekThree().ToString(); - break; - case DataTypes.Int: - txtOutput.Text = pkt.PeekInt().ToString(); - break; - case DataTypes.BreakString: - txtOutput.Text = pkt.PeekBreakString(); - break; - case DataTypes.EndString: - txtOutput.Text = pkt.PeekEndString(); - break; - case DataTypes.FixedString: - txtOutput.Text = pkt.PeekString(m_dataLength); - break; - default: - throw new ArgumentOutOfRangeException(); - } - - int selLen; - if (m_dataLength > 0) selLen = m_dataLength; - else - switch (m_type) - { - case DataTypes.EndString: - selLen = 3*(pkt.Length - pkt.ReadPosition) - 1; - break; - case DataTypes.BreakString: - int oldPos = pkt.ReadPosition; - while (pkt.ReadByte() != 255) ; - selLen = pkt.ReadPosition - oldPos; - pkt.Seek(oldPos, SeekOrigin.Begin); - break; - default: - selLen = 0; - break; - } - txtDecoded.Select(4 * m_packetOffset, 4 * selLen - 1); - - if (m_type == DataTypes.EndString || m_type == DataTypes.BreakString) - { - m_suppressEvent = true; - txtLength.Text = selLen.ToString(); - m_suppressEvent = false; - } - } - - private void btnImportMultis_Click(object sender, EventArgs e) - { - string inp = Microsoft.VisualBasic.Interaction.InputBox("Paste the raw, colon-delimited packet data here: ", "Enter packet data"); - - if (inp.Length == 0) - return; - - inp = inp.Replace(":", ""); - if (inp.Length%2 != 0) return; - inp = inp.Substring(4); - byte[] data = new byte[inp.Length / 2]; - for (int i = 0; i < inp.Length; i += 2) - data[i/2] = Convert.ToByte(inp.Substring(i, 2), 16); - - //no need to decrypt since it's init data - var pkt = new Packet(data); - pkt.Seek(3, SeekOrigin.Current); - txtDMulti.Text = pkt.ReadByte().ToString(); - txtEMulti.Text = pkt.ReadByte().ToString(); - _packetProcessActions.SetEncodeMultiples(pkt.RawData[5], pkt.RawData[6]); - } - } -} diff --git a/PacketDecoder/MainForm.resx b/PacketDecoder/MainForm.resx deleted file mode 100644 index 1af7de150..000000000 --- a/PacketDecoder/MainForm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PacketDecoder/PacketDecoder.csproj b/PacketDecoder/PacketDecoder.csproj deleted file mode 100644 index 1fb6b5b7f..000000000 --- a/PacketDecoder/PacketDecoder.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - net6.0-windows - WinExe - false - ..\bin\$(Configuration)\utils\PacketDecoder - true - true - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PacketDecoder/Program.cs b/PacketDecoder/Program.cs deleted file mode 100644 index 9e7720d8f..000000000 --- a/PacketDecoder/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PacketDecoder -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetHighDpiMode(HighDpiMode.SystemAware); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - } -} diff --git a/PacketDecoder/Properties/AssemblyInfo.cs b/PacketDecoder/Properties/AssemblyInfo.cs deleted file mode 100644 index bc97849e9..000000000 --- a/PacketDecoder/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -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("PacketDecoder")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PacketDecoder")] -[assembly: AssemblyCopyright("Copyright © Ethan Moffat 2014-2016")] -[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("0fec5365-f6be-479f-b449-114ce0e7c977")] - -// 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/PacketDecoder/Properties/Resources.Designer.cs b/PacketDecoder/Properties/Resources.Designer.cs deleted file mode 100644 index 2e9aaf072..000000000 --- a/PacketDecoder/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PacketDecoder.Properties { - using System; - - - /// - /// 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", "4.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 (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PacketDecoder.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/PacketDecoder/Properties/Resources.resx b/PacketDecoder/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/PacketDecoder/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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/PacketDecoder/Properties/Settings.Designer.cs b/PacketDecoder/Properties/Settings.Designer.cs deleted file mode 100644 index 662354e75..000000000 --- a/PacketDecoder/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace PacketDecoder.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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/PacketDecoder/Properties/Settings.settings b/PacketDecoder/Properties/Settings.settings deleted file mode 100644 index 39645652a..000000000 --- a/PacketDecoder/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -