From d7a4918b49a365b6a884a7f07dacbc0d8f053c4f Mon Sep 17 00:00:00 2001 From: XAS-712 Date: Wed, 1 May 2019 10:17:24 +0800 Subject: [PATCH] emmmmm --- MifareOneTool/Form1.Designer.cs | 28 ++++++++++++++-------------- MifareOneTool/Form1.cs | 5 +++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/MifareOneTool/Form1.Designer.cs b/MifareOneTool/Form1.Designer.cs index 1fe8cd7..db9e79b 100644 --- a/MifareOneTool/Form1.Designer.cs +++ b/MifareOneTool/Form1.Designer.cs @@ -107,6 +107,7 @@ this.buttonCLIColor = new System.Windows.Forms.Button(); this.label9 = new System.Windows.Forms.Label(); this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.checkBoxCuidKeyOver = new System.Windows.Forms.CheckBox(); this.checkBoxWriteProtect = new System.Windows.Forms.CheckBox(); this.checkBoxAutoLoadKey = new System.Windows.Forms.CheckBox(); this.checkBoxAutoABN = new System.Windows.Forms.CheckBox(); @@ -117,7 +118,6 @@ this.toolStripCheckUpdate = new System.Windows.Forms.ToolStripSplitButton(); this.curDevice = new System.Windows.Forms.ToolStripStatusLabel(); this.timer1 = new System.Windows.Forms.Timer(this.components); - this.checkBoxCuidKeyOver = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -1118,6 +1118,19 @@ this.groupBox6.TabStop = false; this.groupBox6.Text = "卡操作相关"; // + // checkBoxCuidKeyOver + // + this.checkBoxCuidKeyOver.AutoSize = true; + this.checkBoxCuidKeyOver.Checked = true; + this.checkBoxCuidKeyOver.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxCuidKeyOver.Location = new System.Drawing.Point(4, 72); + this.checkBoxCuidKeyOver.Name = "checkBoxCuidKeyOver"; + this.checkBoxCuidKeyOver.Size = new System.Drawing.Size(108, 16); + this.checkBoxCuidKeyOver.TabIndex = 13; + this.checkBoxCuidKeyOver.Text = "CUID写空卡补丁"; + this.checkBoxCuidKeyOver.UseVisualStyleBackColor = true; + this.checkBoxCuidKeyOver.CheckedChanged += new System.EventHandler(this.checkBoxCuidKeyOver_CheckedChanged); + // // checkBoxWriteProtect // this.checkBoxWriteProtect.AutoSize = true; @@ -1214,19 +1227,6 @@ this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // - // checkBoxCuidKeyOver - // - this.checkBoxCuidKeyOver.AutoSize = true; - this.checkBoxCuidKeyOver.Checked = true; - this.checkBoxCuidKeyOver.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxCuidKeyOver.Location = new System.Drawing.Point(4, 72); - this.checkBoxCuidKeyOver.Name = "checkBoxCuidKeyOver"; - this.checkBoxCuidKeyOver.Size = new System.Drawing.Size(108, 16); - this.checkBoxCuidKeyOver.TabIndex = 13; - this.checkBoxCuidKeyOver.Text = "CUID写空卡补丁"; - this.checkBoxCuidKeyOver.UseVisualStyleBackColor = true; - this.checkBoxCuidKeyOver.CheckedChanged += new System.EventHandler(this.checkBoxCuidKeyOver_CheckedChanged); - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/MifareOneTool/Form1.cs b/MifareOneTool/Form1.cs index e7f38cb..ddc434d 100644 --- a/MifareOneTool/Form1.cs +++ b/MifareOneTool/Form1.cs @@ -172,7 +172,7 @@ namespace MifareOneTool { if (!string.IsNullOrEmpty(_e.Data)) { - Match m = Regex.Match(_e.Data, "pn532_uart:COM\\d:115200"); + Match m = Regex.Match(_e.Data, "pn532_uart:COM\\d+:115200"); if (m.Success) { myReader.Add(m.Value); @@ -862,7 +862,8 @@ namespace MifareOneTool if (keymfd == "" && Properties.Settings.Default.CuidKeyOver) { cuidKeyOver = true; - S50 empty = new S50(); + string uid = GetUID(); + S50 empty = new S50(Utils.Hex2Block(uid,4)); empty.ExportToMfd("cuid_empty.kmf"); keymfd = "cuid_empty.kmf"; logAppend("已启用CUID空卡写入补丁");