Merge branch 'dev'

This commit is contained in:
XAS-712 2019-02-10 17:21:16 +08:00
commit ceeaac8a0e
6 changed files with 559 additions and 170 deletions

View File

@ -31,7 +31,6 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.buttonSniffDev = new System.Windows.Forms.Button();
this.buttonCLI = new System.Windows.Forms.Button();
this.buttonScanCard = new System.Windows.Forms.Button();
this.buttonListDev = new System.Windows.Forms.Button();
@ -63,26 +62,46 @@
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.buttonECheckEncrypt = new System.Windows.Forms.Button();
this.buttonEAdv = new System.Windows.Forms.Button();
this.buttoEScanCard = new System.Windows.Forms.Button();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.buttonECuidWrite = new System.Windows.Forms.Button();
this.buttonEUIDWrite = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.buttonEMfWrite = new System.Windows.Forms.Button();
this.buttonECheckEncrypt = new System.Windows.Forms.Button();
this.buttoEScanCard = new System.Windows.Forms.Button();
this.buttonEscan = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.buttonEReadUID = new System.Windows.Forms.Button();
this.buttonESelectKey = new System.Windows.Forms.Button();
this.buttonECmfoc = new System.Windows.Forms.Button();
this.buttonEMfRead = new System.Windows.Forms.Button();
this.buttonEMfoc = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.groupBox10 = new System.Windows.Forms.GroupBox();
this.buttonHardNested = new System.Windows.Forms.Button();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox13 = new System.Windows.Forms.GroupBox();
this.checkBoxDefIsAdv = new System.Windows.Forms.CheckBox();
this.groupBox12 = new System.Windows.Forms.GroupBox();
this.numericCLIFontSize = new System.Windows.Forms.NumericUpDown();
this.label10 = new System.Windows.Forms.Label();
this.buttonCLIColor = new System.Windows.Forms.Button();
this.label9 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.checkBoxWriteProtect = new System.Windows.Forms.CheckBox();
this.checkBoxAutoLoadKey = new System.Windows.Forms.CheckBox();
this.checkBoxAutoABN = new System.Windows.Forms.CheckBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.runTimeLabel = new System.Windows.Forms.ToolStripStatusLabel();
@ -90,16 +109,7 @@
this.remoteVersionLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripCheckUpdate = new System.Windows.Forms.ToolStripSplitButton();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.checkBoxAutoABN = new System.Windows.Forms.CheckBox();
this.buttonEReadUID = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.checkBoxWriteProtect = new System.Windows.Forms.CheckBox();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.checkBoxAutoSave = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
@ -112,12 +122,16 @@
this.groupBox10.SuspendLayout();
this.groupBox9.SuspendLayout();
this.groupBox8.SuspendLayout();
this.tabPage3.SuspendLayout();
this.groupBox13.SuspendLayout();
this.groupBox12.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericCLIFontSize)).BeginInit();
this.groupBox6.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.buttonSniffDev);
this.groupBox1.Controls.Add(this.buttonCLI);
this.groupBox1.Controls.Add(this.buttonScanCard);
this.groupBox1.Controls.Add(this.buttonListDev);
@ -128,16 +142,6 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "设备控制";
//
// buttonSniffDev
//
this.buttonSniffDev.Enabled = false;
this.buttonSniffDev.Location = new System.Drawing.Point(102, 52);
this.buttonSniffDev.Name = "buttonSniffDev";
this.buttonSniffDev.Size = new System.Drawing.Size(90, 25);
this.buttonSniffDev.TabIndex = 12;
this.buttonSniffDev.Text = "联机嗅探";
this.buttonSniffDev.UseVisualStyleBackColor = true;
//
// buttonCLI
//
this.buttonCLI.Font = new System.Drawing.Font("宋体", 8.5F);
@ -465,8 +469,6 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.checkBoxWriteProtect);
this.groupBox4.Controls.Add(this.checkBoxAutoABN);
this.groupBox4.Controls.Add(this.buttonDiffTool);
this.groupBox4.Controls.Add(this.buttonHexTool);
this.groupBox4.Location = new System.Drawing.Point(3, 94);
@ -480,6 +482,7 @@
//
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(0, 5);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
@ -509,6 +512,72 @@
this.tabPage2.Text = "复制卡模式";
this.tabPage2.UseVisualStyleBackColor = true;
//
// label8
//
this.label8.AutoSize = true;
this.label8.ForeColor = System.Drawing.Color.Green;
this.label8.Location = new System.Drawing.Point(392, 9);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(37, 30);
this.label8.TabIndex = 12;
this.label8.Text = "请放\r\n新卡";
//
// label7
//
this.label7.AutoSize = true;
this.label7.ForeColor = System.Drawing.Color.Green;
this.label7.Location = new System.Drawing.Point(84, 50);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(37, 30);
this.label7.TabIndex = 11;
this.label7.Text = "请放\r\n原卡";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(574, 101);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(159, 15);
this.label6.TabIndex = 10;
this.label6.Text = ">>> 尝试一下是否成功";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(387, 41);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 15);
this.label4.TabIndex = 8;
this.label4.Text = ">>>>>";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(214, 29);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(31, 15);
this.label3.TabIndex = 7;
this.label3.Text = ">>>";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(97, 29);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(23, 15);
this.label2.TabIndex = 6;
this.label2.Text = ">>";
//
// buttonECheckEncrypt
//
this.buttonECheckEncrypt.Location = new System.Drawing.Point(123, 55);
this.buttonECheckEncrypt.Name = "buttonECheckEncrypt";
this.buttonECheckEncrypt.Size = new System.Drawing.Size(85, 25);
this.buttonECheckEncrypt.TabIndex = 5;
this.buttonECheckEncrypt.Text = "检测加密";
this.buttonECheckEncrypt.UseVisualStyleBackColor = true;
this.buttonECheckEncrypt.Click += new System.EventHandler(this.buttonECheckEncrypt_Click);
//
// buttonEAdv
//
this.buttonEAdv.Location = new System.Drawing.Point(574, 6);
@ -519,6 +588,16 @@
this.buttonEAdv.UseVisualStyleBackColor = true;
this.buttonEAdv.Click += new System.EventHandler(this.buttonEAdv_Click);
//
// buttoEScanCard
//
this.buttoEScanCard.Location = new System.Drawing.Point(123, 24);
this.buttoEScanCard.Name = "buttoEScanCard";
this.buttoEScanCard.Size = new System.Drawing.Size(85, 25);
this.buttoEScanCard.TabIndex = 1;
this.buttoEScanCard.Text = "扫描卡片";
this.buttoEScanCard.UseVisualStyleBackColor = true;
this.buttoEScanCard.Click += new System.EventHandler(this.buttoEScanCard_Click);
//
// groupBox7
//
this.groupBox7.Controls.Add(this.buttonECuidWrite);
@ -572,26 +651,6 @@
this.buttonEMfWrite.UseVisualStyleBackColor = true;
this.buttonEMfWrite.Click += new System.EventHandler(this.buttonEMfWrite_Click);
//
// buttonECheckEncrypt
//
this.buttonECheckEncrypt.Location = new System.Drawing.Point(123, 55);
this.buttonECheckEncrypt.Name = "buttonECheckEncrypt";
this.buttonECheckEncrypt.Size = new System.Drawing.Size(85, 25);
this.buttonECheckEncrypt.TabIndex = 5;
this.buttonECheckEncrypt.Text = "检测加密";
this.buttonECheckEncrypt.UseVisualStyleBackColor = true;
this.buttonECheckEncrypt.Click += new System.EventHandler(this.buttonECheckEncrypt_Click);
//
// buttoEScanCard
//
this.buttoEScanCard.Location = new System.Drawing.Point(123, 24);
this.buttoEScanCard.Name = "buttoEScanCard";
this.buttoEScanCard.Size = new System.Drawing.Size(85, 25);
this.buttoEScanCard.TabIndex = 1;
this.buttoEScanCard.Text = "扫描卡片";
this.buttoEScanCard.UseVisualStyleBackColor = true;
this.buttoEScanCard.Click += new System.EventHandler(this.buttoEScanCard_Click);
//
// buttonEscan
//
this.buttonEscan.Location = new System.Drawing.Point(8, 24);
@ -616,6 +675,16 @@
this.groupBox5.TabStop = false;
this.groupBox5.Text = "[2]读取原卡";
//
// buttonEReadUID
//
this.buttonEReadUID.Location = new System.Drawing.Point(6, 49);
this.buttonEReadUID.Name = "buttonEReadUID";
this.buttonEReadUID.Size = new System.Drawing.Size(116, 25);
this.buttonEReadUID.TabIndex = 3;
this.buttonEReadUID.Text = "从UID卡读回";
this.buttonEReadUID.UseVisualStyleBackColor = true;
this.buttonEReadUID.Click += new System.EventHandler(this.buttonEReadUID_Click);
//
// buttonESelectKey
//
this.buttonESelectKey.Location = new System.Drawing.Point(6, 109);
@ -656,6 +725,17 @@
this.buttonEMfoc.UseVisualStyleBackColor = true;
this.buttonEMfoc.Click += new System.EventHandler(this.buttonEMfoc_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.Blue;
this.label5.Location = new System.Drawing.Point(8, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(232, 165);
this.label5.TabIndex = 9;
this.label5.Text = "从这里开始\r\n\r\n\r\n\r\n\r\n\r\n\r\n本工具仅支持SAK=08/18/28的\r\n卡片复制。SAK28无一键解密。\r\n若要复制S70卡片请在高级界\r\n面上取消勾选" +
"“数据写入保护”。\r\n";
//
// tabPage1
//
this.tabPage1.Controls.Add(this.groupBox10);
@ -734,6 +814,157 @@
this.groupBox8.TabStop = false;
this.groupBox8.Text = "UID/UFUID卡操作";
//
// tabPage3
//
this.tabPage3.Controls.Add(this.groupBox13);
this.tabPage3.Controls.Add(this.groupBox12);
this.tabPage3.Controls.Add(this.groupBox6);
this.tabPage3.Location = new System.Drawing.Point(4, 25);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(759, 183);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "软件设置";
this.tabPage3.UseVisualStyleBackColor = true;
//
// groupBox13
//
this.groupBox13.Controls.Add(this.checkBoxAutoSave);
this.groupBox13.Controls.Add(this.checkBoxDefIsAdv);
this.groupBox13.Location = new System.Drawing.Point(3, 109);
this.groupBox13.Name = "groupBox13";
this.groupBox13.Size = new System.Drawing.Size(200, 71);
this.groupBox13.TabIndex = 13;
this.groupBox13.TabStop = false;
this.groupBox13.Text = "偏好设置";
//
// checkBoxDefIsAdv
//
this.checkBoxDefIsAdv.AutoSize = true;
this.checkBoxDefIsAdv.Location = new System.Drawing.Point(9, 24);
this.checkBoxDefIsAdv.Name = "checkBoxDefIsAdv";
this.checkBoxDefIsAdv.Size = new System.Drawing.Size(179, 19);
this.checkBoxDefIsAdv.TabIndex = 0;
this.checkBoxDefIsAdv.Text = "自动转到高级操作模式";
this.checkBoxDefIsAdv.UseVisualStyleBackColor = true;
this.checkBoxDefIsAdv.CheckedChanged += new System.EventHandler(this.checkBoxDefIsAdv_CheckedChanged);
//
// groupBox12
//
this.groupBox12.Controls.Add(this.numericCLIFontSize);
this.groupBox12.Controls.Add(this.label10);
this.groupBox12.Controls.Add(this.buttonCLIColor);
this.groupBox12.Controls.Add(this.label9);
this.groupBox12.Location = new System.Drawing.Point(209, 3);
this.groupBox12.Name = "groupBox12";
this.groupBox12.Size = new System.Drawing.Size(200, 80);
this.groupBox12.TabIndex = 12;
this.groupBox12.TabStop = false;
this.groupBox12.Text = "界面设置";
//
// numericCLIFontSize
//
this.numericCLIFontSize.DecimalPlaces = 1;
this.numericCLIFontSize.Location = new System.Drawing.Point(109, 47);
this.numericCLIFontSize.Maximum = new decimal(new int[] {
36,
0,
0,
0});
this.numericCLIFontSize.Minimum = new decimal(new int[] {
7,
0,
0,
0});
this.numericCLIFontSize.Name = "numericCLIFontSize";
this.numericCLIFontSize.Size = new System.Drawing.Size(85, 25);
this.numericCLIFontSize.TabIndex = 16;
this.numericCLIFontSize.Value = new decimal(new int[] {
9,
0,
0,
0});
this.numericCLIFontSize.ValueChanged += new System.EventHandler(this.numericCLIFontSize_ValueChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(6, 50);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(97, 15);
this.label10.TabIndex = 15;
this.label10.Text = "终端文字大小";
//
// buttonCLIColor
//
this.buttonCLIColor.BackColor = System.Drawing.Color.Black;
this.buttonCLIColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.buttonCLIColor.ForeColor = System.Drawing.Color.Lime;
this.buttonCLIColor.Location = new System.Drawing.Point(109, 16);
this.buttonCLIColor.Name = "buttonCLIColor";
this.buttonCLIColor.Size = new System.Drawing.Size(85, 25);
this.buttonCLIColor.TabIndex = 14;
this.buttonCLIColor.Text = "#M1T#";
this.buttonCLIColor.UseVisualStyleBackColor = false;
this.buttonCLIColor.Click += new System.EventHandler(this.buttonCLIColor_Click);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(6, 21);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(97, 15);
this.label9.TabIndex = 13;
this.label9.Text = "终端文字颜色";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.checkBoxWriteProtect);
this.groupBox6.Controls.Add(this.checkBoxAutoLoadKey);
this.groupBox6.Controls.Add(this.checkBoxAutoABN);
this.groupBox6.Location = new System.Drawing.Point(3, 3);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(200, 100);
this.groupBox6.TabIndex = 0;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "卡操作相关";
//
// checkBoxWriteProtect
//
this.checkBoxWriteProtect.AutoSize = true;
this.checkBoxWriteProtect.Checked = true;
this.checkBoxWriteProtect.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxWriteProtect.Location = new System.Drawing.Point(6, 74);
this.checkBoxWriteProtect.Name = "checkBoxWriteProtect";
this.checkBoxWriteProtect.Size = new System.Drawing.Size(165, 19);
this.checkBoxWriteProtect.TabIndex = 11;
this.checkBoxWriteProtect.Text = "数据写入保护(建议)";
this.checkBoxWriteProtect.UseVisualStyleBackColor = true;
this.checkBoxWriteProtect.CheckedChanged += new System.EventHandler(this.checkBoxWriteProtect_CheckedChanged);
//
// checkBoxAutoLoadKey
//
this.checkBoxAutoLoadKey.AutoSize = true;
this.checkBoxAutoLoadKey.Location = new System.Drawing.Point(6, 49);
this.checkBoxAutoLoadKey.Name = "checkBoxAutoLoadKey";
this.checkBoxAutoLoadKey.Size = new System.Drawing.Size(175, 19);
this.checkBoxAutoLoadKey.TabIndex = 12;
this.checkBoxAutoLoadKey.Text = "自动加载uid.Key文件";
this.checkBoxAutoLoadKey.UseVisualStyleBackColor = true;
this.checkBoxAutoLoadKey.CheckedChanged += new System.EventHandler(this.checkBoxAutoLoadKey_CheckedChanged);
//
// checkBoxAutoABN
//
this.checkBoxAutoABN.AutoSize = true;
this.checkBoxAutoABN.Checked = true;
this.checkBoxAutoABN.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoABN.Location = new System.Drawing.Point(6, 24);
this.checkBoxAutoABN.Name = "checkBoxAutoABN";
this.checkBoxAutoABN.Size = new System.Drawing.Size(161, 19);
this.checkBoxAutoABN.TabIndex = 2;
this.checkBoxAutoABN.Text = "自动判断Key(beta)";
this.checkBoxAutoABN.UseVisualStyleBackColor = true;
this.checkBoxAutoABN.CheckedChanged += new System.EventHandler(this.checkBoxAutoABN_CheckedChanged);
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -791,108 +1022,16 @@
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// checkBoxAutoABN
// checkBoxAutoSave
//
this.checkBoxAutoABN.AutoSize = true;
this.checkBoxAutoABN.Checked = true;
this.checkBoxAutoABN.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoABN.Location = new System.Drawing.Point(120, 25);
this.checkBoxAutoABN.Name = "checkBoxAutoABN";
this.checkBoxAutoABN.Size = new System.Drawing.Size(161, 19);
this.checkBoxAutoABN.TabIndex = 2;
this.checkBoxAutoABN.Text = "自动判断Key(beta)";
this.checkBoxAutoABN.UseVisualStyleBackColor = true;
this.checkBoxAutoABN.CheckedChanged += new System.EventHandler(this.checkBoxAutoABN_CheckedChanged);
//
// buttonEReadUID
//
this.buttonEReadUID.Location = new System.Drawing.Point(6, 49);
this.buttonEReadUID.Name = "buttonEReadUID";
this.buttonEReadUID.Size = new System.Drawing.Size(116, 25);
this.buttonEReadUID.TabIndex = 3;
this.buttonEReadUID.Text = "从UID卡读回";
this.buttonEReadUID.UseVisualStyleBackColor = true;
this.buttonEReadUID.Click += new System.EventHandler(this.buttonEReadUID_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(97, 29);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(23, 15);
this.label2.TabIndex = 6;
this.label2.Text = ">>";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(214, 29);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(31, 15);
this.label3.TabIndex = 7;
this.label3.Text = ">>>";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(387, 41);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(47, 15);
this.label4.TabIndex = 8;
this.label4.Text = ">>>>>";
//
// label5
//
this.label5.AutoSize = true;
this.label5.ForeColor = System.Drawing.Color.Blue;
this.label5.Location = new System.Drawing.Point(8, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(232, 165);
this.label5.TabIndex = 9;
this.label5.Text = "从这里开始\r\n\r\n\r\n\r\n\r\n\r\n\r\n本工具仅支持SAK=08/18/28的\r\n卡片复制。\r\n若要复制S70卡片请在高级界\r\n面上取消勾选“数据写入保护”。\r\n" +
"";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(574, 101);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(159, 15);
this.label6.TabIndex = 10;
this.label6.Text = ">>> 尝试一下是否成功";
//
// checkBoxWriteProtect
//
this.checkBoxWriteProtect.AutoSize = true;
this.checkBoxWriteProtect.Checked = true;
this.checkBoxWriteProtect.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxWriteProtect.Location = new System.Drawing.Point(120, 55);
this.checkBoxWriteProtect.Name = "checkBoxWriteProtect";
this.checkBoxWriteProtect.Size = new System.Drawing.Size(165, 19);
this.checkBoxWriteProtect.TabIndex = 11;
this.checkBoxWriteProtect.Text = "数据写入保护(建议)";
this.checkBoxWriteProtect.UseVisualStyleBackColor = true;
this.checkBoxWriteProtect.CheckedChanged += new System.EventHandler(this.checkBoxWriteProtect_CheckedChanged);
//
// label7
//
this.label7.AutoSize = true;
this.label7.ForeColor = System.Drawing.Color.Green;
this.label7.Location = new System.Drawing.Point(84, 50);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(37, 30);
this.label7.TabIndex = 11;
this.label7.Text = "请放\r\n原卡";
//
// label8
//
this.label8.AutoSize = true;
this.label8.ForeColor = System.Drawing.Color.Green;
this.label8.Location = new System.Drawing.Point(392, 9);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(37, 30);
this.label8.TabIndex = 12;
this.label8.Text = "请放\r\n新卡";
this.checkBoxAutoSave.AutoSize = true;
this.checkBoxAutoSave.Location = new System.Drawing.Point(9, 46);
this.checkBoxAutoSave.Name = "checkBoxAutoSave";
this.checkBoxAutoSave.Size = new System.Drawing.Size(173, 19);
this.checkBoxAutoSave.TabIndex = 1;
this.checkBoxAutoSave.Text = "自动以UID名保存文件";
this.checkBoxAutoSave.UseVisualStyleBackColor = true;
this.checkBoxAutoSave.CheckedChanged += new System.EventHandler(this.checkBoxAutoSave_CheckedChanged);
//
// Form1
//
@ -907,12 +1046,12 @@
this.MaximizeBox = false;
this.Name = "Form1";
this.Text = "MifareOne Tool";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
@ -923,6 +1062,14 @@
this.groupBox9.ResumeLayout(false);
this.groupBox9.PerformLayout();
this.groupBox8.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.groupBox13.ResumeLayout(false);
this.groupBox13.PerformLayout();
this.groupBox12.ResumeLayout(false);
this.groupBox12.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericCLIFontSize)).EndInit();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false);
@ -991,8 +1138,6 @@
private System.Windows.Forms.ToolStripSplitButton toolStripCheckUpdate;
private System.Windows.Forms.Button buttonDictMfoc;
private System.Windows.Forms.Button buttonnKeysMfoc;
private System.Windows.Forms.Button buttonSniffDev;
private System.Windows.Forms.CheckBox checkBoxAutoABN;
private System.Windows.Forms.Button buttonEReadUID;
private System.Windows.Forms.CheckBox checkBoxWriteProtect;
private System.Windows.Forms.Label label6;
@ -1002,6 +1147,18 @@
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox checkBoxAutoABN;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.CheckBox checkBoxAutoLoadKey;
private System.Windows.Forms.GroupBox groupBox12;
private System.Windows.Forms.Button buttonCLIColor;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.NumericUpDown numericCLIFontSize;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.GroupBox groupBox13;
private System.Windows.Forms.CheckBox checkBoxDefIsAdv;
private System.Windows.Forms.CheckBox checkBoxAutoSave;
}
}

View File

@ -47,33 +47,55 @@ namespace MifareOneTool
}
else if (e.ProgressPercentage == 101)
{
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
ofd.Title = "请选择MFD文件保存位置及文件名";
ofd.OverwritePrompt = true;
ofd.Filter = "MFD文件|*.mfd|DUMP文件|*.dump";
if (File.Exists(omfd) && new FileInfo(omfd).Length > 1)
if (lastuid != "")
{
if (ofd.ShowDialog() == DialogResult.OK)
if (File.Exists(omfd) && new FileInfo(omfd).Length > 1)
{
if (File.Exists(ofd.FileName))
string filename = lastuid + "_" + DateTime.Now.ToString() + ".mfd";
if (File.Exists(filename))
{
File.Delete(ofd.FileName);
File.Delete(filename);
}
File.Move(omfd, ofd.FileName);
logAppend("##已保存-" + ofd.FileName + "##");
File.Move(omfd, filename);
logAppend("##已自动保存-" + filename + "##");
}
else
{
File.Delete(omfd);
logAppend("##未保存##");
logAppend("##缓存文件异常##");
}
lastuid = "";
}
else
{
File.Delete(omfd);
logAppend("##缓存文件异常##");
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
ofd.Title = "请选择MFD文件保存位置及文件名";
ofd.OverwritePrompt = true;
ofd.Filter = "MFD文件|*.mfd|DUMP文件|*.dump";
if (File.Exists(omfd) && new FileInfo(omfd).Length > 1)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
if (File.Exists(ofd.FileName))
{
File.Delete(ofd.FileName);
}
File.Move(omfd, ofd.FileName);
logAppend("##已保存-" + ofd.FileName + "##");
}
else
{
File.Delete(omfd);
logAppend("##未保存##");
}
}
else
{
File.Delete(omfd);
logAppend("##缓存文件异常##");
}
}
omfd = "";
Text = "MifareOne Tool - 运行完毕";
@ -117,8 +139,17 @@ namespace MifareOneTool
//GitHubUpdate ghu = new GitHubUpdate(Properties.Settings.Default.GitHubR);
//ghu.Update(Properties.Settings.Default.GitHubR);
//remoteVersionLabel.Text = "远程版本 " + ghu.remoteVersion;
Directory.CreateDirectory("auto_keys");
checkBoxAutoABN.Checked = Properties.Settings.Default.AutoABN;
checkBoxWriteProtect.Checked = Properties.Settings.Default.WriteCheck;
checkBoxAutoLoadKey.Checked = Properties.Settings.Default.AutoLoadUidKey;
richTextBox1.ForeColor = Properties.Settings.Default.MainCLIColor;
buttonCLIColor.ForeColor = Properties.Settings.Default.MainCLIColor;
checkBoxDefIsAdv.Checked = Properties.Settings.Default.DefIsAdv;
if (Properties.Settings.Default.DefIsAdv)
{
tabControl1.SelectedIndex = 1;
}
}
private void buttonScanCard_Click(object sender, EventArgs e)
@ -154,12 +185,69 @@ namespace MifareOneTool
string omfd = "";
private string GetUID()
{
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/nfc-list.exe");
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
Process p = Process.Start(psi);
p.WaitForExit();
string rawStr = p.StandardOutput.ReadToEnd();
string uid;
string pattern = @"UID\s\(NFCID1\)\: ([0-9A-Fa-f]{2}\s\s[0-9A-Fa-f]{2}\s\s[0-9A-Fa-f]{2}\s\s[0-9A-Fa-f]{2})";
if (Regex.IsMatch(rawStr, pattern))
{
uid = Regex.Match(rawStr, pattern).Captures[0].Value.Replace(" ", "").Replace("UID(NFCID1):", ""); ;
}
else
{
uid = "";
}
return uid;
}
private void LoadUidKey(string uid)
{
if (!Directory.Exists("auto_keys"))
{
Directory.CreateDirectory("auto_keys");
return;
}
if (uid.Length < 8) { return; }
logAppend("正在检索是否存在key.mfd…");
List<string> files = Directory.EnumerateFiles("auto_keys", "*.mfd").ToList<string>();
for (int i = 0; i < files.Count; i++)
{
if (files[i].StartsWith("auto_keys\\" + uid))
{
logAppend("已找到K=" + files[i]);
keymfd = files[i];
buttonSelectKey.Text = "K=" + files[i];
return;
}
}
return;
}
string lastuid = "";
private void buttonMfRead_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
string rmfd = "MfRead.tmp";
string kt = "A";
string nn = "";
string uid;
if (checkBoxAutoLoadKey.Checked)
{
uid = GetUID();
LoadUidKey(uid);
}
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
}
if (checkBoxAutoABN.Checked && keymfd != "")
{
kt = "C";
@ -366,6 +454,10 @@ namespace MifareOneTool
}
}
}
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(mfoc);
bgw.WorkerReportsProgress = true;
@ -492,7 +584,10 @@ namespace MifareOneTool
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
string rmfd = "BmfRead.tmp";
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(bmf_read);
bgw.WorkerReportsProgress = true;
@ -906,7 +1001,7 @@ namespace MifareOneTool
private void buttonEAdv_Click(object sender, EventArgs e)
{
tabControl1.SelectedIndex = tabControl1.TabPages.Count - 1;
tabControl1.SelectedIndex = 1;
}
private void buttonEnAcr122u_Click(object sender, EventArgs e)
@ -1025,6 +1120,10 @@ namespace MifareOneTool
}
}
}
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(mfoc);
bgw.WorkerReportsProgress = true;
@ -1058,6 +1157,10 @@ namespace MifareOneTool
}
string rmfd = "Mfoc.tmp";
string key = "-f " + filename + " ";
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(mfocCMD);
bgw.WorkerReportsProgress = true;
@ -1160,5 +1263,44 @@ namespace MifareOneTool
b.ReportProgress(100, "##运行出错##");
}
}
private void checkBoxAutoLoadKey_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.AutoLoadUidKey = checkBoxAutoLoadKey.Checked;
}
private void buttonCLIColor_Click(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog();
cd.AllowFullOpen = true;
cd.AnyColor = true;
if (cd.ShowDialog() == DialogResult.OK)
{
richTextBox1.ForeColor = cd.Color;
buttonCLIColor.ForeColor = cd.Color;
Properties.Settings.Default.MainCLIColor = cd.Color;
}
}
private void numericCLIFontSize_ValueChanged(object sender, EventArgs e)
{
richTextBox1.Font = new Font(richTextBox1.Font.FontFamily, (float)numericCLIFontSize.Value);
Properties.Settings.Default.MainCLIFontSize = (float)numericCLIFontSize.Value;
}
private void checkBoxDefIsAdv_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.DefIsAdv = checkBoxDefIsAdv.Checked;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.Save();
}
private void checkBoxAutoSave_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default.AutoSave = checkBoxAutoSave.Checked;
}
}
}

View File

@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("XciCode")]
[assembly: AssemblyProduct("MifareOneTool")]
[assembly: AssemblyCopyright("Copyright © XciCode 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyTrademark("M1T")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.2.0")]
[assembly: AssemblyFileVersion("1.6.2.0")]
[assembly: AssemblyVersion("1.6.4.0")]
[assembly: AssemblyFileVersion("1.6.4.0")]

View File

@ -55,5 +55,65 @@ namespace MifareOneTool.Properties {
this["WriteCheck"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AutoLoadUidKey {
get {
return ((bool)(this["AutoLoadUidKey"]));
}
set {
this["AutoLoadUidKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Lime")]
public global::System.Drawing.Color MainCLIColor {
get {
return ((global::System.Drawing.Color)(this["MainCLIColor"]));
}
set {
this["MainCLIColor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("9")]
public float MainCLIFontSize {
get {
return ((float)(this["MainCLIFontSize"]));
}
set {
this["MainCLIFontSize"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool DefIsAdv {
get {
return ((bool)(this["DefIsAdv"]));
}
set {
this["DefIsAdv"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool AutoSave {
get {
return ((bool)(this["AutoSave"]));
}
set {
this["AutoSave"] = value;
}
}
}
}

View File

@ -11,5 +11,20 @@
<Setting Name="WriteCheck" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="AutoLoadUidKey" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="MainCLIColor" Type="System.Drawing.Color" Scope="User">
<Value Profile="(Default)">Lime</Value>
</Setting>
<Setting Name="MainCLIFontSize" Type="System.Single" Scope="User">
<Value Profile="(Default)">9</Value>
</Setting>
<Setting Name="DefIsAdv" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoSave" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@ -23,6 +23,21 @@
<setting name="WriteCheck" serializeAs="String">
<value>True</value>
</setting>
<setting name="AutoLoadUidKey" serializeAs="String">
<value>False</value>
</setting>
<setting name="MainCLIColor" serializeAs="String">
<value>Lime</value>
</setting>
<setting name="MainCLIFontSize" serializeAs="String">
<value>9</value>
</setting>
<setting name="DefIsAdv" serializeAs="String">
<value>False</value>
</setting>
<setting name="AutoSave" serializeAs="String">
<value>False</value>
</setting>
</MifareOneTool.Properties.Settings>
</userSettings>
</configuration>