本帖最后由 hotpower 于 2023-10-31 09:08 编辑
菜农电子淘宝:https://hotcomlock.taobao.com/ 准备出书:http://hotcomlock.com/hotcomlock.html
namespace Stm32DataCheck
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox8 = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.textBox7 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.textBox9 = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.textBox10 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.textBox11 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox12 = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.textBox13 = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.textBox14 = new System.Windows.Forms.TextBox();
this.label14 = new System.Windows.Forms.Label();
this.textBox15 = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.textBox16 = new System.Windows.Forms.TextBox();
this.label16 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.textBox17 = new System.Windows.Forms.TextBox();
this.label17 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.button2 = new System.Windows.Forms.Button();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.textBox20 = new System.Windows.Forms.TextBox();
this.textBox19 = new System.Windows.Forms.TextBox();
this.textBox18 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox8);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.textBox7);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.textBox6);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.textBox5);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.textBox4);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 48);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(213, 294);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "原始数组";
//
// textBox8
//
this.textBox8.Enabled = false;
this.textBox8.Location = new System.Drawing.Point(67, 251);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(133, 25);
this.textBox8.TabIndex = 15;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(16, 254);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(45, 15);
this.label8.TabIndex = 14;
this.label8.Text = "初值2";
//
// textBox7
//
this.textBox7.Enabled = false;
this.textBox7.Location = new System.Drawing.Point(67, 220);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(133, 25);
this.textBox7.TabIndex = 13;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(16, 223);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(45, 15);
this.label7.TabIndex = 12;
this.label7.Text = "初值1";
//
// textBox6
//
this.textBox6.Enabled = false;
this.textBox6.Location = new System.Drawing.Point(67, 189);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(133, 25);
this.textBox6.TabIndex = 11;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(16, 192);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(52, 15);
this.label6.TabIndex = 10;
this.label6.Text = "总长度";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(67, 158);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(133, 25);
this.textBox5.TabIndex = 9;
this.textBox5.Text = "08000000";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(16, 161);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(52, 15);
this.label5.TabIndex = 8;
this.label5.Text = "基地址";
//
// textBox4
//
this.textBox4.Enabled = false;
this.textBox4.Location = new System.Drawing.Point(67, 127);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(133, 25);
this.textBox4.TabIndex = 7;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(16, 130);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 15);
this.label4.TabIndex = 6;
this.label4.Text = "多项式";
//
// textBox3
//
this.textBox3.Enabled = false;
this.textBox3.Location = new System.Drawing.Point(67, 96);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(133, 25);
this.textBox3.TabIndex = 5;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(16, 99);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 15);
this.label3.TabIndex = 4;
this.label3.Text = "ID123";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(67, 65);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(133, 25);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "AAAAAAAA";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 68);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(45, 15);
this.label2.TabIndex = 2;
this.label2.Text = "索引2";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(67, 34);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(133, 25);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "55555555";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 37);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(45, 15);
this.label1.TabIndex = 0;
this.label1.Text = "索引1";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textBox9);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.textBox10);
this.groupBox2.Controls.Add(this.label10);
this.groupBox2.Controls.Add(this.textBox11);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.textBox12);
this.groupBox2.Controls.Add(this.label12);
this.groupBox2.Controls.Add(this.textBox13);
this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.textBox14);
this.groupBox2.Controls.Add(this.label14);
this.groupBox2.Controls.Add(this.textBox15);
this.groupBox2.Controls.Add(this.label15);
this.groupBox2.Controls.Add(this.textBox16);
this.groupBox2.Controls.Add(this.label16);
this.groupBox2.Location = new System.Drawing.Point(12, 348);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(213, 294);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "结果数组";
//
// textBox9
//
this.textBox9.Location = new System.Drawing.Point(67, 251);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(133, 25);
this.textBox9.TabIndex = 15;
this.textBox9.TextChanged += new System.EventHandler(this.textBox9_TextChanged);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(16, 254);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(45, 15);
this.label9.TabIndex = 14;
this.label9.Text = "初值2";
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(67, 220);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(133, 25);
this.textBox10.TabIndex = 13;
this.textBox10.TextChanged += new System.EventHandler(this.textBox10_TextChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(16, 223);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(45, 15);
this.label10.TabIndex = 12;
this.label10.Text = "初值1";
//
// textBox11
//
this.textBox11.Location = new System.Drawing.Point(67, 189);
this.textBox11.Name = "textBox11";
this.textBox11.Size = new System.Drawing.Size(133, 25);
this.textBox11.TabIndex = 11;
this.textBox11.TextChanged += new System.EventHandler(this.textBox11_TextChanged);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(16, 192);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(52, 15);
this.label11.TabIndex = 10;
this.label11.Text = "总长度";
//
// textBox12
//
this.textBox12.Location = new System.Drawing.Point(67, 158);
this.textBox12.Name = "textBox12";
this.textBox12.Size = new System.Drawing.Size(133, 25);
this.textBox12.TabIndex = 9;
this.textBox12.TextChanged += new System.EventHandler(this.textBox12_TextChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(16, 161);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(52, 15);
this.label12.TabIndex = 8;
this.label12.Text = "基地址";
//
// textBox13
//
this.textBox13.Location = new System.Drawing.Point(67, 127);
this.textBox13.Name = "textBox13";
this.textBox13.Size = new System.Drawing.Size(133, 25);
this.textBox13.TabIndex = 7;
this.textBox13.TextChanged += new System.EventHandler(this.textBox13_TextChanged);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(16, 130);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(52, 15);
this.label13.TabIndex = 6;
this.label13.Text = "多项式";
//
// textBox14
//
this.textBox14.Location = new System.Drawing.Point(67, 96);
this.textBox14.Name = "textBox14";
this.textBox14.Size = new System.Drawing.Size(133, 25);
this.textBox14.TabIndex = 5;
this.textBox14.TextChanged += new System.EventHandler(this.textBox14_TextChanged);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(16, 99);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(47, 15);
this.label14.TabIndex = 4;
this.label14.Text = "ID123";
//
// textBox15
//
this.textBox15.Location = new System.Drawing.Point(67, 65);
this.textBox15.Name = "textBox15";
this.textBox15.Size = new System.Drawing.Size(133, 25);
this.textBox15.TabIndex = 3;
this.textBox15.TextChanged += new System.EventHandler(this.textBox15_TextChanged);
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(16, 68);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(45, 15);
this.label15.TabIndex = 2;
this.label15.Text = "索引2";
//
// textBox16
//
this.textBox16.Location = new System.Drawing.Point(67, 34);
this.textBox16.Name = "textBox16";
this.textBox16.Size = new System.Drawing.Size(133, 25);
this.textBox16.TabIndex = 1;
this.textBox16.TextChanged += new System.EventHandler(this.textBox16_TextChanged);
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(16, 37);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(45, 15);
this.label16.TabIndex = 0;
this.label16.Text = "索引1";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.listBox1);
this.groupBox3.Location = new System.Drawing.Point(231, 48);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(483, 507);
this.groupBox3.TabIndex = 2;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Hex文件";
//
// listBox1
//
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 15;
this.listBox1.Location = new System.Drawing.Point(6, 24);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(471, 469);
this.listBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(493, 17);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 14;
this.button1.Text = "装载";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox17
//
this.textBox17.Location = new System.Drawing.Point(110, 17);
this.textBox17.Name = "textBox17";
this.textBox17.Size = new System.Drawing.Size(377, 25);
this.textBox17.TabIndex = 13;
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(28, 20);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(76, 15);
this.label17.TabIndex = 12;
this.label17.Text = "Hex文件名";
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// statusStrip1
//
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1,
this.toolStripStatusLabel2,
this.toolStripStatusLabel3});
this.statusStrip1.Location = new System.Drawing.Point(0, 650);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0);
this.statusStrip1.Size = new System.Drawing.Size(729, 25);
this.statusStrip1.TabIndex = 18;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(84, 20);
this.toolStripStatusLabel1.Text = "系统提示:";
//
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.AutoSize = false;
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(251, 20);
this.toolStripStatusLabel2.Text = "雁塔菜农HotPower[url=home.php?mod=space&uid=516618]@163.com[/url] 2023.10.27 ";
this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// toolStripStatusLabel3
//
this.toolStripStatusLabel3.AutoSize = false;
this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
this.toolStripStatusLabel3.Size = new System.Drawing.Size(208, 20);
this.toolStripStatusLabel3.Text = "2023-11-19 18:18:18 星期四";
this.toolStripStatusLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// button2
//
this.button2.Location = new System.Drawing.Point(639, 17);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 25);
this.button2.TabIndex = 19;
this.button2.Text = "计算";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(574, 20);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(59, 19);
this.checkBox1.TabIndex = 20;
this.checkBox1.Text = "随机";
this.checkBox1.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Controls.Add(this.button4);
this.groupBox4.Controls.Add(this.button3);
this.groupBox4.Controls.Add(this.textBox20);
this.groupBox4.Controls.Add(this.textBox19);
this.groupBox4.Controls.Add(this.textBox18);
this.groupBox4.Location = new System.Drawing.Point(231, 567);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(483, 57);
this.groupBox4.TabIndex = 21;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "ID";
//
// textBox20
//
this.textBox20.Location = new System.Drawing.Point(192, 24);
this.textBox20.Name = "textBox20";
this.textBox20.Size = new System.Drawing.Size(87, 25);
this.textBox20.TabIndex = 6;
this.textBox20.Text = "1A55C84B";
//
// textBox19
//
this.textBox19.Location = new System.Drawing.Point(99, 24);
this.textBox19.Name = "textBox19";
this.textBox19.Size = new System.Drawing.Size(87, 25);
this.textBox19.TabIndex = 5;
this.textBox19.Text = "45734649";
//
// textBox18
//
this.textBox18.Location = new System.Drawing.Point(6, 24);
this.textBox18.Name = "textBox18";
this.textBox18.Size = new System.Drawing.Size(87, 25);
this.textBox18.TabIndex = 4;
this.textBox18.Text = "77EFA51F";
//
// button3
//
this.button3.Location = new System.Drawing.Point(393, 24);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 25);
this.button3.TabIndex = 20;
this.button3.Text = "计算";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(312, 24);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 25);
this.button4.TabIndex = 21;
this.button4.Text = "随机";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(729, 675);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.textBox17);
this.Controls.Add(this.label17);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Stm32利用CRC初值碰撞反篡改(V1.0.1)";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox textBox9;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox10;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.TextBox textBox11;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.TextBox textBox12;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox textBox13;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TextBox textBox14;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.TextBox textBox15;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.TextBox textBox16;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox textBox17;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.TextBox textBox20;
private System.Windows.Forms.TextBox textBox19;
private System.Windows.Forms.TextBox textBox18;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
}
}
using System;
using System.Management;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Security.Cryptography;
using Microsoft.Win32;
namespace Stm32DataCheck
{
public partial class Form1 : Form
{
UInt32[] CRCDataBuffers;
int CRCDataAddress = 0;
public Form1()
{
InitializeComponent();
}
public UInt32 CRC32Valx(UInt32 output, UInt32 poly, UInt32 init, UInt32 xorout)
{
output ^= xorout;
if ((poly & 0x80000001) == 0)
{
output ^= (UInt32)(poly ^ 0x80000001);
}
if ((poly & 1) > 0)
{
for (int i = 0; i < 32; i++)
{
if ((output & 1) > 0)
{
output ^= poly;
output >>= 1;
output |= 0x80000000;
}
else
{
output >>= 1;
}
}
}
else
{
for (int i = 0; i < 32; i++)
{
if ((output & 0x80000000) > 0)
{
output ^= poly;
output <<= 1;
output |= 1;
}
else
{
output <<= 1;
}
}
output &= 0xffffffff;
}
output ^= init;
return output;
}
private Byte GetHexCheckSum(string str)
{
Byte CheckSum = 0xFF;
if (str.Length >= 11 && (str.Length & 1) == 1 && str.Substring(0, 1) == ":")
{
string Data = str.Substring(1, str.Length - 1);
CheckSum = 0;
for(int i = 0; i < Data.Length; i += 2)
{
CheckSum += Convert.ToByte(Data.Substring(i, 2), 16);
}
}
return CheckSum;
}
private Byte GetHexLength(string str)
{
Byte len = 0;
if (str.Length >= 11 && (str.Length & 1) == 1 && str.Substring(0, 1) == ":")
{
len = Convert.ToByte(str.Substring(1, 2), 16);
}
return len;
}
private UInt16 GetHexAddress(string str)
{
UInt16 Address = 0;
if (str.Length >= 11 && (str.Length & 1) == 1 && str.Substring(0, 1) == ":")
{
Address = Convert.ToUInt16(str.Substring(3, 4), 16);
}
return Address;
}
private string GetHexRecordType(string str)
{
string RecordType = "";
if (str.Length >= 11 && (str.Length & 1) == 1 && str.Substring(0, 1) == ":")
{
RecordType = str.Substring(7, 2);
}
return RecordType;
}
private string GetHexData(string str)
{
string Data = "";
if (str.Length >= 13 && (str.Length & 1) == 1 && str.Substring(0, 1) == ":")
{
Data = str.Substring(9, str.Length - 11);
}
return Data;
}
private void LoadHexFile(ListBox listBox1)
{
UInt32 len = 0;
UInt32 FLASH_BASE0 = 0;
UInt32 FLASH_BASE1 = 0;
string str = listBox1.Items[0].ToString();
string ptr = listBox1.Items[1].ToString();
string ctr;
if (GetHexRecordType(str) == "04" && GetHexRecordType(ptr) == "00")
{
textBox12.Text = GetHexData(str) + GetHexAddress(ptr).ToString("X4");
FLASH_BASE0 = Convert.ToUInt32(textBox12.Text, 16);
}
FLASH_BASE1 = FLASH_BASE0;
for(int i = 1;i < listBox1.Items.Count; i++)
{
str = listBox1.Items[i].ToString();
if(GetHexRecordType(str) == "04")
{
ptr = listBox1.Items[i + 1].ToString();
ctr = GetHexData(str) + GetHexAddress(ptr).ToString("X4");
FLASH_BASE1 = Convert.ToUInt32(ctr, 16);
}
else if (GetHexRecordType(str) == "00")
{
len = FLASH_BASE1 + GetHexAddress(str) + GetHexLength(str);
}
else if (GetHexRecordType(str) == "01")
{
len -= FLASH_BASE0;
textBox11.Text = len.ToString("X8");
CRCDataBuffers = new UInt32[len];
int pos = 0;
for(int k = 1;k < listBox1.Items.Count - 1; k ++)
{
str = listBox1.Items[k].ToString();
if (GetHexRecordType(str) == "00")
{
ptr = GetHexData(str);
int size = GetHexLength(str);
for (int n = 0; n < size / 4; n ++)
{
ctr = ptr.Substring(n * 8 + 6, 2) + ptr.Substring(n * 8 + 4, 2) + ptr.Substring(n * 8 + 2, 2) + ptr.Substring(n * 8, 2);
CRCDataBuffers[pos++] = Convert.ToUInt32(ctr, 16);
}
}
}
}
}
}
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string filename = openFileDialog1.FileName;
if(Path.GetExtension(filename).ToUpper() == ".HEX")
{
textBox17.Text = filename;
listBox1.Items.Clear();
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
int line = 1;
while (true)
{
string text = sr.ReadLine();
if (text == null) break;
if(GetHexCheckSum(text) != 0)
{
toolStripStatusLabel2.Text = "第" + line.ToString() + "行出错";
break;
}
listBox1.Items.Add(text);
line++;
Application.DoEvents();
}
sr.Close();
fs.Close();
if(listBox1.Items.Count < 4)
{
MessageBox.Show("文件" + filename + "行数太少!!!", "文件错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
LoadHexFile(listBox1);
}
}
}
private void DataCheck()
{
int len = (int)CRCDataBuffers[CRCDataAddress + 5] / 4;
UInt32 CRC32Init;
UInt32 crc32;
UInt32 crcpoly = CRCDataBuffers[CRCDataAddress + 3];
int pos1 = (int)(CRCDataAddress + 6);
int pos2 = (int)(CRCDataAddress + 7);
CRC32Init = 0;
int i;
for (i = len - 1; i >= 0; i--)
{
crc32 = CRCDataBuffers[i];
if (!(i == pos1 || i == pos2))
{
CRC32Init = CRC32Valx(CRC32Init, crcpoly, crc32, 0);
}
}
CRCDataBuffers[pos1] = CRC32Init;
textBox10.Text = CRC32Init.ToString("X8");
CRC32Init = 0;
for (i = 0; i < len; i++)
{
crc32 = CRCDataBuffers[i];
if (!(i == pos2))
{
CRC32Init = CRC32Valx(CRC32Init, crcpoly, crc32, 0);
}
}
CRCDataBuffers[pos2] = CRC32Init;
textBox9.Text = CRC32Init.ToString("X8");
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime sysDateTime = DateTime.Now;
toolStripStatusLabel3.Text = sysDateTime.ToString("yyyy-MM-dd HH:mm:ss dddd");
}
private void button2_Click(object sender, EventArgs e)
{
textBox10.Text = "";
textBox9.Text = "";
CRCDataAddress = 0;
if (textBox18.Text.Length == 8 && textBox19.Text.Length == 8 && textBox20.Text.Length == 8)
{
UInt32 poly = Convert.ToUInt32(textBox18.Text, 16);
UInt32 init = Convert.ToUInt32(textBox19.Text, 16);
UInt32 xorout = Convert.ToUInt32(textBox20.Text, 16);
textBox14.Text = CRC32Valx(0, poly, init, xorout).ToString("X8");
}
if (textBox1.Text.Length == 8 && textBox2.Text.Length == 8 && textBox5.Text.Length == 8)
{
if (CRCDataBuffers != null && textBox11.Text.Length == 8 && textBox12.Text.Length == 8)
{
int len = Convert.ToInt32(textBox11.Text, 16);
UInt32 index1 = Convert.ToUInt32(textBox1.Text, 16);
UInt32 index2 = Convert.ToUInt32(textBox2.Text, 16);
UInt32 FLASH_BASE = Convert.ToUInt32(textBox5.Text, 16);
UInt32 FLASH_BASE0 = Convert.ToUInt32(textBox12.Text, 16);
if(FLASH_BASE == FLASH_BASE0)
{
for (int i = 0; i < len / 4; i++)
{
if(CRCDataBuffers[i] == index1)
{
if (CRCDataBuffers[i + 1] == index2)
{
if (CRCDataBuffers[i + 4] == FLASH_BASE0)
{
if(CRCDataAddress != 0)
{
MessageBox.Show("索引1和索引2有多个,请更换!!!", "参数错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
CRCDataAddress = i;
textBox3.Text = CRCDataBuffers[i + 2].ToString("X8");
textBox4.Text = CRCDataBuffers[i + 3].ToString("X8");
textBox5.Text = CRCDataBuffers[i + 4].ToString("X8");
textBox6.Text = CRCDataBuffers[i + 5].ToString("X8");
textBox7.Text = CRCDataBuffers[i + 6].ToString("X8");
textBox8.Text = CRCDataBuffers[i + 7].ToString("X8");
textBox16.Text = CRCDataBuffers[i].ToString("X8");
textBox15.Text = CRCDataBuffers[i + 1].ToString("X8");
//textBox14.Text = CRCDataBuffers[i + 2].ToString("X8");
CRCDataBuffers[i + 2] = Convert.ToUInt32(textBox14.Text, 16);
//textBox13.Text = CRCDataBuffers[i + 3].ToString("X8");
if (checkBox1.Checked)
{
Random systemrd = new Random();
textBox13.Text = systemrd.Next(0, 0x7fffffff).ToString("X8");
}
else
{
textBox13.Text = CRCDataBuffers[i + 3].ToString("X8");
}
CRCDataBuffers[i + 3] = Convert.ToUInt32(textBox13.Text, 16);
textBox12.Text = CRCDataBuffers[i + 4].ToString("X8");
//textBox11.Text = CRCDataBuffers[i + 5].ToString("X8");
CRCDataBuffers[i + 5] = Convert.ToUInt32(textBox11.Text, 16);
//textBox10.Text = CRCDataBuffers[i + 6].ToString("X8");
//textBox9.Text = CRCDataBuffers[i + 7].ToString("X8");
DataCheck();
}
}
}
}
}
else
{
MessageBox.Show("基地址输入错误!!!", "参数错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("HEX文件装载错误!!!", "装载错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("请输入索引1、索引2、基地址!!!", "参数错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if(textBox9.Text == "" && textBox10.Text == "")
{
textBox16.Text = "";
textBox15.Text = "";
textBox14.Text = "";
textBox13.Text = "";
}
}
private void button4_Click(object sender, EventArgs e)
{
Random systemrd = new Random();
textBox18.Text = systemrd.Next(0, 0x7fffffff).ToString("X8");
textBox19.Text = systemrd.Next(0, 0x7fffffff).ToString("X8");
textBox20.Text = systemrd.Next(0, 0x7fffffff).ToString("X8");
}
private void button3_Click(object sender, EventArgs e)
{
if (textBox18.Text.Length == 8 && textBox19.Text.Length == 8 && textBox20.Text.Length == 8)
{
UInt32 poly = Convert.ToUInt32(textBox18.Text, 16);
UInt32 init = Convert.ToUInt32(textBox19.Text, 16);
UInt32 xorout = Convert.ToUInt32(textBox20.Text, 16);
textBox14.Text = CRC32Valx(0, poly, init, xorout).ToString("X8");
}
}
private void textBox16_TextChanged(object sender, EventArgs e)
{
}
private void textBox15_TextChanged(object sender, EventArgs e)
{
}
private void textBox14_TextChanged(object sender, EventArgs e)
{
}
private void textBox13_TextChanged(object sender, EventArgs e)
{
}
private void textBox12_TextChanged(object sender, EventArgs e)
{
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
}
private void textBox10_TextChanged(object sender, EventArgs e)
{
}
private void textBox9_TextChanged(object sender, EventArgs e)
{
}
}
}
|
|