添加Hardnested
This commit is contained in:
parent
35b1179e89
commit
b7bbf15c38
34
MifareOneTool/Form1.Designer.cs
generated
34
MifareOneTool/Form1.Designer.cs
generated
@ -98,6 +98,8 @@
|
|||||||
this.label5 = new System.Windows.Forms.Label();
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
this.label6 = new System.Windows.Forms.Label();
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
this.checkBoxWriteProtect = new System.Windows.Forms.CheckBox();
|
this.checkBoxWriteProtect = new System.Windows.Forms.CheckBox();
|
||||||
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
this.groupBox1.SuspendLayout();
|
this.groupBox1.SuspendLayout();
|
||||||
this.groupBox2.SuspendLayout();
|
this.groupBox2.SuspendLayout();
|
||||||
this.groupBox3.SuspendLayout();
|
this.groupBox3.SuspendLayout();
|
||||||
@ -179,7 +181,7 @@
|
|||||||
this.richTextBox1.Location = new System.Drawing.Point(0, 219);
|
this.richTextBox1.Location = new System.Drawing.Point(0, 219);
|
||||||
this.richTextBox1.Name = "richTextBox1";
|
this.richTextBox1.Name = "richTextBox1";
|
||||||
this.richTextBox1.ReadOnly = true;
|
this.richTextBox1.ReadOnly = true;
|
||||||
this.richTextBox1.Size = new System.Drawing.Size(767, 381);
|
this.richTextBox1.Size = new System.Drawing.Size(767, 390);
|
||||||
this.richTextBox1.TabIndex = 1;
|
this.richTextBox1.TabIndex = 1;
|
||||||
this.richTextBox1.Text = "Hello,cardman!\n建议点击\"检测\"以加快后续运行速度\n";
|
this.richTextBox1.Text = "Hello,cardman!\n建议点击\"检测\"以加快后续运行速度\n";
|
||||||
//
|
//
|
||||||
@ -486,6 +488,8 @@
|
|||||||
//
|
//
|
||||||
// tabPage2
|
// tabPage2
|
||||||
//
|
//
|
||||||
|
this.tabPage2.Controls.Add(this.label8);
|
||||||
|
this.tabPage2.Controls.Add(this.label7);
|
||||||
this.tabPage2.Controls.Add(this.label6);
|
this.tabPage2.Controls.Add(this.label6);
|
||||||
this.tabPage2.Controls.Add(this.label4);
|
this.tabPage2.Controls.Add(this.label4);
|
||||||
this.tabPage2.Controls.Add(this.label3);
|
this.tabPage2.Controls.Add(this.label3);
|
||||||
@ -686,13 +690,13 @@
|
|||||||
//
|
//
|
||||||
// buttonHardNested
|
// buttonHardNested
|
||||||
//
|
//
|
||||||
this.buttonHardNested.Enabled = false;
|
|
||||||
this.buttonHardNested.Location = new System.Drawing.Point(178, 51);
|
this.buttonHardNested.Location = new System.Drawing.Point(178, 51);
|
||||||
this.buttonHardNested.Name = "buttonHardNested";
|
this.buttonHardNested.Name = "buttonHardNested";
|
||||||
this.buttonHardNested.Size = new System.Drawing.Size(104, 25);
|
this.buttonHardNested.Size = new System.Drawing.Size(104, 25);
|
||||||
this.buttonHardNested.TabIndex = 14;
|
this.buttonHardNested.TabIndex = 14;
|
||||||
this.buttonHardNested.Text = "HardNested";
|
this.buttonHardNested.Text = "HardNested";
|
||||||
this.buttonHardNested.UseVisualStyleBackColor = true;
|
this.buttonHardNested.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonHardNested.Click += new System.EventHandler(this.buttonHardNested_Click);
|
||||||
//
|
//
|
||||||
// groupBox9
|
// groupBox9
|
||||||
//
|
//
|
||||||
@ -738,7 +742,7 @@
|
|||||||
this.localVersionLabel,
|
this.localVersionLabel,
|
||||||
this.remoteVersionLabel,
|
this.remoteVersionLabel,
|
||||||
this.toolStripCheckUpdate});
|
this.toolStripCheckUpdate});
|
||||||
this.statusStrip1.Location = new System.Drawing.Point(0, 603);
|
this.statusStrip1.Location = new System.Drawing.Point(0, 609);
|
||||||
this.statusStrip1.Name = "statusStrip1";
|
this.statusStrip1.Name = "statusStrip1";
|
||||||
this.statusStrip1.Size = new System.Drawing.Size(767, 26);
|
this.statusStrip1.Size = new System.Drawing.Size(767, 26);
|
||||||
this.statusStrip1.TabIndex = 12;
|
this.statusStrip1.TabIndex = 12;
|
||||||
@ -870,11 +874,31 @@
|
|||||||
this.checkBoxWriteProtect.UseVisualStyleBackColor = true;
|
this.checkBoxWriteProtect.UseVisualStyleBackColor = true;
|
||||||
this.checkBoxWriteProtect.CheckedChanged += new System.EventHandler(this.checkBoxWriteProtect_CheckedChanged);
|
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新卡";
|
||||||
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(767, 629);
|
this.ClientSize = new System.Drawing.Size(767, 635);
|
||||||
this.Controls.Add(this.statusStrip1);
|
this.Controls.Add(this.statusStrip1);
|
||||||
this.Controls.Add(this.tabControl1);
|
this.Controls.Add(this.tabControl1);
|
||||||
this.Controls.Add(this.richTextBox1);
|
this.Controls.Add(this.richTextBox1);
|
||||||
@ -976,6 +1000,8 @@
|
|||||||
private System.Windows.Forms.Label label3;
|
private System.Windows.Forms.Label label3;
|
||||||
private System.Windows.Forms.Label label2;
|
private System.Windows.Forms.Label label2;
|
||||||
private System.Windows.Forms.Label label5;
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Label label8;
|
||||||
|
private System.Windows.Forms.Label label7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1113,5 +1113,52 @@ namespace MifareOneTool
|
|||||||
{
|
{
|
||||||
Properties.Settings.Default.WriteCheck = checkBoxWriteProtect.Checked;
|
Properties.Settings.Default.WriteCheck = checkBoxWriteProtect.Checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buttonHardNested_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
|
||||||
|
FormHardNes fhn = new FormHardNes();
|
||||||
|
if (fhn.ShowDialog() == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
string hardargs = fhn.GetArg();
|
||||||
|
BackgroundWorker bgw = new BackgroundWorker();
|
||||||
|
bgw.DoWork += new DoWorkEventHandler(Hardnest);
|
||||||
|
bgw.WorkerReportsProgress = true;
|
||||||
|
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
|
||||||
|
bgw.RunWorkerAsync(hardargs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Text = "MifareOne Tool - 已取消";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void Hardnest(object sender, DoWorkEventArgs e)
|
||||||
|
{
|
||||||
|
if (lprocess) { return; }
|
||||||
|
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/libnfc_hardnested.exe");
|
||||||
|
psi.Arguments = (string)e.Argument;
|
||||||
|
psi.CreateNoWindow = true;
|
||||||
|
psi.UseShellExecute = false;
|
||||||
|
psi.RedirectStandardOutput = true;
|
||||||
|
psi.RedirectStandardError = true;
|
||||||
|
lprocess = true;
|
||||||
|
BackgroundWorker b = (BackgroundWorker)sender;
|
||||||
|
process = Process.Start(psi); running = true;
|
||||||
|
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
|
||||||
|
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
|
||||||
|
//StreamReader stderr = process.StandardError;
|
||||||
|
process.BeginOutputReadLine();
|
||||||
|
process.BeginErrorReadLine();
|
||||||
|
process.WaitForExit();
|
||||||
|
lprocess = false; running = false;
|
||||||
|
if (process.ExitCode == 0)
|
||||||
|
{
|
||||||
|
b.ReportProgress(100, "##运行完毕##");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b.ReportProgress(100, "##运行出错##");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
273
MifareOneTool/FormHardNes.Designer.cs
generated
Normal file
273
MifareOneTool/FormHardNes.Designer.cs
generated
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
namespace MifareOneTool
|
||||||
|
{
|
||||||
|
partial class FormHardNes
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.button2 = new System.Windows.Forms.Button();
|
||||||
|
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.keyEdit = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.radioKey1A = new System.Windows.Forms.RadioButton();
|
||||||
|
this.radioKey1B = new System.Windows.Forms.RadioButton();
|
||||||
|
this.radioKey2B = new System.Windows.Forms.RadioButton();
|
||||||
|
this.radioKey2A = new System.Windows.Forms.RadioButton();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||||
|
this.sector2 = new System.Windows.Forms.TextBox();
|
||||||
|
this.sector1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.groupBox1.SuspendLayout();
|
||||||
|
this.groupBox2.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(308, 187);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(75, 25);
|
||||||
|
this.button1.TabIndex = 0;
|
||||||
|
this.button1.Text = "解密!";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// button2
|
||||||
|
//
|
||||||
|
this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.button2.Location = new System.Drawing.Point(227, 187);
|
||||||
|
this.button2.Name = "button2";
|
||||||
|
this.button2.Size = new System.Drawing.Size(75, 25);
|
||||||
|
this.button2.TabIndex = 1;
|
||||||
|
this.button2.Text = "取消";
|
||||||
|
this.button2.UseVisualStyleBackColor = true;
|
||||||
|
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||||
|
//
|
||||||
|
// groupBox1
|
||||||
|
//
|
||||||
|
this.groupBox1.Controls.Add(this.radioKey1B);
|
||||||
|
this.groupBox1.Controls.Add(this.radioKey1A);
|
||||||
|
this.groupBox1.Controls.Add(this.label4);
|
||||||
|
this.groupBox1.Controls.Add(this.label3);
|
||||||
|
this.groupBox1.Controls.Add(this.sector1);
|
||||||
|
this.groupBox1.Controls.Add(this.keyEdit);
|
||||||
|
this.groupBox1.Controls.Add(this.label2);
|
||||||
|
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||||
|
this.groupBox1.Name = "groupBox1";
|
||||||
|
this.groupBox1.Size = new System.Drawing.Size(371, 81);
|
||||||
|
this.groupBox1.TabIndex = 2;
|
||||||
|
this.groupBox1.TabStop = false;
|
||||||
|
this.groupBox1.Text = "目标卡信息";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.ForeColor = System.Drawing.Color.Blue;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 192);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(202, 15);
|
||||||
|
this.label1.TabIndex = 3;
|
||||||
|
this.label1.Text = "解密时请保证设备良好散热!";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(6, 21);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(76, 15);
|
||||||
|
this.label2.TabIndex = 0;
|
||||||
|
this.label2.Text = "已知的Key";
|
||||||
|
//
|
||||||
|
// keyEdit
|
||||||
|
//
|
||||||
|
this.keyEdit.Location = new System.Drawing.Point(9, 39);
|
||||||
|
this.keyEdit.Name = "keyEdit";
|
||||||
|
this.keyEdit.Size = new System.Drawing.Size(120, 25);
|
||||||
|
this.keyEdit.TabIndex = 10;
|
||||||
|
this.keyEdit.Text = "ffffffffffff";
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(132, 21);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(52, 15);
|
||||||
|
this.label3.TabIndex = 12;
|
||||||
|
this.label3.Text = "扇区号";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(190, 21);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(37, 15);
|
||||||
|
this.label4.TabIndex = 13;
|
||||||
|
this.label4.Text = "类型";
|
||||||
|
//
|
||||||
|
// radioKey1A
|
||||||
|
//
|
||||||
|
this.radioKey1A.AutoSize = true;
|
||||||
|
this.radioKey1A.Checked = true;
|
||||||
|
this.radioKey1A.Location = new System.Drawing.Point(193, 40);
|
||||||
|
this.radioKey1A.Name = "radioKey1A";
|
||||||
|
this.radioKey1A.Size = new System.Drawing.Size(60, 19);
|
||||||
|
this.radioKey1A.TabIndex = 14;
|
||||||
|
this.radioKey1A.TabStop = true;
|
||||||
|
this.radioKey1A.Text = "KeyA";
|
||||||
|
this.radioKey1A.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// radioKey1B
|
||||||
|
//
|
||||||
|
this.radioKey1B.AutoSize = true;
|
||||||
|
this.radioKey1B.Location = new System.Drawing.Point(259, 40);
|
||||||
|
this.radioKey1B.Name = "radioKey1B";
|
||||||
|
this.radioKey1B.Size = new System.Drawing.Size(60, 19);
|
||||||
|
this.radioKey1B.TabIndex = 15;
|
||||||
|
this.radioKey1B.Text = "KeyB";
|
||||||
|
this.radioKey1B.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// radioKey2B
|
||||||
|
//
|
||||||
|
this.radioKey2B.AutoSize = true;
|
||||||
|
this.radioKey2B.Location = new System.Drawing.Point(259, 40);
|
||||||
|
this.radioKey2B.Name = "radioKey2B";
|
||||||
|
this.radioKey2B.Size = new System.Drawing.Size(60, 19);
|
||||||
|
this.radioKey2B.TabIndex = 15;
|
||||||
|
this.radioKey2B.Text = "KeyB";
|
||||||
|
this.radioKey2B.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// radioKey2A
|
||||||
|
//
|
||||||
|
this.radioKey2A.AutoSize = true;
|
||||||
|
this.radioKey2A.Checked = true;
|
||||||
|
this.radioKey2A.Location = new System.Drawing.Point(193, 40);
|
||||||
|
this.radioKey2A.Name = "radioKey2A";
|
||||||
|
this.radioKey2A.Size = new System.Drawing.Size(60, 19);
|
||||||
|
this.radioKey2A.TabIndex = 14;
|
||||||
|
this.radioKey2A.TabStop = true;
|
||||||
|
this.radioKey2A.Text = "KeyA";
|
||||||
|
this.radioKey2A.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(190, 21);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(37, 15);
|
||||||
|
this.label5.TabIndex = 13;
|
||||||
|
this.label5.Text = "类型";
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.Location = new System.Drawing.Point(132, 21);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(52, 15);
|
||||||
|
this.label6.TabIndex = 12;
|
||||||
|
this.label6.Text = "扇区号";
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
this.groupBox2.Controls.Add(this.radioKey2B);
|
||||||
|
this.groupBox2.Controls.Add(this.radioKey2A);
|
||||||
|
this.groupBox2.Controls.Add(this.label5);
|
||||||
|
this.groupBox2.Controls.Add(this.label6);
|
||||||
|
this.groupBox2.Controls.Add(this.sector2);
|
||||||
|
this.groupBox2.Location = new System.Drawing.Point(12, 99);
|
||||||
|
this.groupBox2.Name = "groupBox2";
|
||||||
|
this.groupBox2.Size = new System.Drawing.Size(371, 81);
|
||||||
|
this.groupBox2.TabIndex = 16;
|
||||||
|
this.groupBox2.TabStop = false;
|
||||||
|
this.groupBox2.Text = "解密设置";
|
||||||
|
//
|
||||||
|
// sector2
|
||||||
|
//
|
||||||
|
this.sector2.Location = new System.Drawing.Point(135, 39);
|
||||||
|
this.sector2.Name = "sector2";
|
||||||
|
this.sector2.Size = new System.Drawing.Size(46, 25);
|
||||||
|
this.sector2.TabIndex = 11;
|
||||||
|
this.sector2.Text = "1";
|
||||||
|
//
|
||||||
|
// sector1
|
||||||
|
//
|
||||||
|
this.sector1.Location = new System.Drawing.Point(135, 39);
|
||||||
|
this.sector1.Name = "sector1";
|
||||||
|
this.sector1.Size = new System.Drawing.Size(46, 25);
|
||||||
|
this.sector1.TabIndex = 11;
|
||||||
|
this.sector1.Text = "0";
|
||||||
|
//
|
||||||
|
// FormHardNes
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.button1;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.button2;
|
||||||
|
this.ClientSize = new System.Drawing.Size(395, 224);
|
||||||
|
this.ControlBox = false;
|
||||||
|
this.Controls.Add(this.groupBox2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.groupBox1);
|
||||||
|
this.Controls.Add(this.button2);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.KeyPreview = true;
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "FormHardNes";
|
||||||
|
this.Text = "初始化HardNested解密";
|
||||||
|
this.groupBox1.ResumeLayout(false);
|
||||||
|
this.groupBox1.PerformLayout();
|
||||||
|
this.groupBox2.ResumeLayout(false);
|
||||||
|
this.groupBox2.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
private System.Windows.Forms.Button button2;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.RadioButton radioKey1B;
|
||||||
|
private System.Windows.Forms.RadioButton radioKey1A;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.TextBox keyEdit;
|
||||||
|
private System.Windows.Forms.RadioButton radioKey2B;
|
||||||
|
private System.Windows.Forms.RadioButton radioKey2A;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.GroupBox groupBox2;
|
||||||
|
private System.Windows.Forms.TextBox sector2;
|
||||||
|
private System.Windows.Forms.TextBox sector1;
|
||||||
|
}
|
||||||
|
}
|
||||||
111
MifareOneTool/FormHardNes.cs
Normal file
111
MifareOneTool/FormHardNes.cs
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace MifareOneTool
|
||||||
|
{
|
||||||
|
public partial class FormHardNes : Form
|
||||||
|
{
|
||||||
|
public FormHardNes()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int getBlock(int sector)
|
||||||
|
{//可能有bug
|
||||||
|
int trailer_block = 0;
|
||||||
|
if (sector < 32)
|
||||||
|
{
|
||||||
|
trailer_block = sector*4 + 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trailer_block = 128+16*(sector-32) + 15;
|
||||||
|
}
|
||||||
|
return trailer_block;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetArg()
|
||||||
|
{
|
||||||
|
string arg = "";
|
||||||
|
arg += keyEdit.Text.ToUpper() + " ";
|
||||||
|
arg += getBlock(Convert.ToInt32(sector1.Text.Trim())).ToString() + " ";
|
||||||
|
arg += (radioKey1A.Checked ?"A":"B") + " ";
|
||||||
|
arg += getBlock(Convert.ToInt32(sector2.Text.Trim())).ToString() + " ";
|
||||||
|
arg += radioKey2A.Checked ? "A" : "B";
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button2_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.DialogResult = DialogResult.Cancel;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
bool error = false;
|
||||||
|
const string pattern = @"[0-9A-Fa-f]{12}";
|
||||||
|
TextBox tb = keyEdit;
|
||||||
|
string content = tb.Text.Trim();
|
||||||
|
if (!(Regex.IsMatch(content, pattern) && content.Length == 12))
|
||||||
|
{
|
||||||
|
tb.BackColor = Color.Tomato;
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tb.BackColor = Color.Aquamarine;
|
||||||
|
tb.Text = content;
|
||||||
|
}
|
||||||
|
int sec1, sec2;
|
||||||
|
if (!int.TryParse(sector1.Text, out sec1))
|
||||||
|
{
|
||||||
|
sector1.BackColor = Color.Tomato;
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sec1 >= 0)
|
||||||
|
{
|
||||||
|
sector1.BackColor = Color.Aquamarine;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sector1.BackColor = Color.Tomato;
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!int.TryParse(sector2.Text, out sec2))
|
||||||
|
{
|
||||||
|
sector2.BackColor = Color.Tomato;
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sec2 >= 0)
|
||||||
|
{
|
||||||
|
sector2.BackColor = Color.Aquamarine;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sector2.BackColor = Color.Tomato;
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
MessageBox.Show("设置错误,请修改。");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.DialogResult = DialogResult.Yes;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
MifareOneTool/FormHardNes.resx
Normal file
120
MifareOneTool/FormHardNes.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
@ -83,6 +83,12 @@
|
|||||||
<Compile Include="FormDiff.Designer.cs">
|
<Compile Include="FormDiff.Designer.cs">
|
||||||
<DependentUpon>FormDiff.cs</DependentUpon>
|
<DependentUpon>FormDiff.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="FormHardNes.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="FormHardNes.Designer.cs">
|
||||||
|
<DependentUpon>FormHardNes.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="FormHTool.cs">
|
<Compile Include="FormHTool.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -98,6 +104,9 @@
|
|||||||
<EmbeddedResource Include="FormDiff.resx">
|
<EmbeddedResource Include="FormDiff.resx">
|
||||||
<DependentUpon>FormDiff.cs</DependentUpon>
|
<DependentUpon>FormDiff.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="FormHardNes.resx">
|
||||||
|
<DependentUpon>FormHardNes.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="FormHTool.resx">
|
<EmbeddedResource Include="FormHTool.resx">
|
||||||
<DependentUpon>FormHTool.cs</DependentUpon>
|
<DependentUpon>FormHTool.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user