增加写CUID卡功能
This commit is contained in:
parent
594f751595
commit
96e8b9f22f
113
MifareOneTool/Form1.Designer.cs
generated
113
MifareOneTool/Form1.Designer.cs
generated
@ -49,12 +49,14 @@
|
||||
this.buttonKill = new System.Windows.Forms.Button();
|
||||
this.buttonConSave = new System.Windows.Forms.Button();
|
||||
this.buttonConClr = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.buttonMfcuk = new System.Windows.Forms.Button();
|
||||
this.buttonHexTool = new System.Windows.Forms.Button();
|
||||
this.buttonTool1 = new System.Windows.Forms.Button();
|
||||
this.toolTipHelp = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.buttonSuperCard = new System.Windows.Forms.Button();
|
||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
||||
this.buttonCmfWrite = new System.Windows.Forms.Button();
|
||||
this.buttonLockUfuid = new System.Windows.Forms.Button();
|
||||
this.buttonMfFormat = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
@ -87,6 +89,7 @@
|
||||
//
|
||||
// buttonCLI
|
||||
//
|
||||
this.buttonCLI.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonCLI.Location = new System.Drawing.Point(102, 24);
|
||||
this.buttonCLI.Name = "buttonCLI";
|
||||
this.buttonCLI.Size = new System.Drawing.Size(90, 23);
|
||||
@ -97,6 +100,7 @@
|
||||
//
|
||||
// buttonScanCard
|
||||
//
|
||||
this.buttonScanCard.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonScanCard.Location = new System.Drawing.Point(6, 53);
|
||||
this.buttonScanCard.Name = "buttonScanCard";
|
||||
this.buttonScanCard.Size = new System.Drawing.Size(90, 23);
|
||||
@ -107,6 +111,7 @@
|
||||
//
|
||||
// buttonListDev
|
||||
//
|
||||
this.buttonListDev.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonListDev.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonListDev.Name = "buttonListDev";
|
||||
this.buttonListDev.Size = new System.Drawing.Size(90, 23);
|
||||
@ -119,15 +124,16 @@
|
||||
//
|
||||
this.richTextBox1.BackColor = System.Drawing.Color.Black;
|
||||
this.richTextBox1.ForeColor = System.Drawing.Color.Lime;
|
||||
this.richTextBox1.Location = new System.Drawing.Point(12, 101);
|
||||
this.richTextBox1.Location = new System.Drawing.Point(12, 190);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.ReadOnly = true;
|
||||
this.richTextBox1.Size = new System.Drawing.Size(623, 293);
|
||||
this.richTextBox1.Size = new System.Drawing.Size(623, 300);
|
||||
this.richTextBox1.TabIndex = 1;
|
||||
this.richTextBox1.Text = "Hello,cardman!\n建议点击\"检测\"以加快后续运行速度\n";
|
||||
//
|
||||
// buttonMfRead
|
||||
//
|
||||
this.buttonMfRead.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonMfRead.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonMfRead.Name = "buttonMfRead";
|
||||
this.buttonMfRead.Size = new System.Drawing.Size(75, 23);
|
||||
@ -156,6 +162,7 @@
|
||||
//
|
||||
// buttonBmfWrite
|
||||
//
|
||||
this.buttonBmfWrite.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonBmfWrite.Location = new System.Drawing.Point(330, 53);
|
||||
this.buttonBmfWrite.Name = "buttonBmfWrite";
|
||||
this.buttonBmfWrite.Size = new System.Drawing.Size(75, 23);
|
||||
@ -166,6 +173,7 @@
|
||||
//
|
||||
// buttonBmfRead
|
||||
//
|
||||
this.buttonBmfRead.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonBmfRead.Location = new System.Drawing.Point(330, 24);
|
||||
this.buttonBmfRead.Name = "buttonBmfRead";
|
||||
this.buttonBmfRead.Size = new System.Drawing.Size(75, 23);
|
||||
@ -176,6 +184,7 @@
|
||||
//
|
||||
// buttonMfoc
|
||||
//
|
||||
this.buttonMfoc.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonMfoc.Location = new System.Drawing.Point(249, 53);
|
||||
this.buttonMfoc.Name = "buttonMfoc";
|
||||
this.buttonMfoc.Size = new System.Drawing.Size(75, 23);
|
||||
@ -187,6 +196,7 @@
|
||||
//
|
||||
// buttonUidWrite
|
||||
//
|
||||
this.buttonUidWrite.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonUidWrite.Location = new System.Drawing.Point(168, 53);
|
||||
this.buttonUidWrite.Name = "buttonUidWrite";
|
||||
this.buttonUidWrite.Size = new System.Drawing.Size(75, 23);
|
||||
@ -197,6 +207,7 @@
|
||||
//
|
||||
// buttonUidFormat
|
||||
//
|
||||
this.buttonUidFormat.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonUidFormat.Location = new System.Drawing.Point(249, 24);
|
||||
this.buttonUidFormat.Name = "buttonUidFormat";
|
||||
this.buttonUidFormat.Size = new System.Drawing.Size(75, 23);
|
||||
@ -207,6 +218,7 @@
|
||||
//
|
||||
// buttonUidReset
|
||||
//
|
||||
this.buttonUidReset.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonUidReset.Location = new System.Drawing.Point(168, 24);
|
||||
this.buttonUidReset.Name = "buttonUidReset";
|
||||
this.buttonUidReset.Size = new System.Drawing.Size(75, 23);
|
||||
@ -217,6 +229,7 @@
|
||||
//
|
||||
// buttonMfWrite
|
||||
//
|
||||
this.buttonMfWrite.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonMfWrite.Location = new System.Drawing.Point(87, 24);
|
||||
this.buttonMfWrite.Name = "buttonMfWrite";
|
||||
this.buttonMfWrite.Size = new System.Drawing.Size(75, 23);
|
||||
@ -227,6 +240,7 @@
|
||||
//
|
||||
// buttonSelectKey
|
||||
//
|
||||
this.buttonSelectKey.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonSelectKey.Location = new System.Drawing.Point(6, 53);
|
||||
this.buttonSelectKey.Name = "buttonSelectKey";
|
||||
this.buttonSelectKey.Size = new System.Drawing.Size(156, 23);
|
||||
@ -240,7 +254,7 @@
|
||||
this.groupBox3.Controls.Add(this.buttonKill);
|
||||
this.groupBox3.Controls.Add(this.buttonConSave);
|
||||
this.groupBox3.Controls.Add(this.buttonConClr);
|
||||
this.groupBox3.Location = new System.Drawing.Point(641, 12);
|
||||
this.groupBox3.Location = new System.Drawing.Point(467, 101);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(169, 83);
|
||||
this.groupBox3.TabIndex = 5;
|
||||
@ -249,6 +263,7 @@
|
||||
//
|
||||
// buttonKill
|
||||
//
|
||||
this.buttonKill.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonKill.Location = new System.Drawing.Point(6, 53);
|
||||
this.buttonKill.Name = "buttonKill";
|
||||
this.buttonKill.Size = new System.Drawing.Size(75, 23);
|
||||
@ -259,6 +274,7 @@
|
||||
//
|
||||
// buttonConSave
|
||||
//
|
||||
this.buttonConSave.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonConSave.Location = new System.Drawing.Point(87, 24);
|
||||
this.buttonConSave.Name = "buttonConSave";
|
||||
this.buttonConSave.Size = new System.Drawing.Size(75, 23);
|
||||
@ -269,6 +285,7 @@
|
||||
//
|
||||
// buttonConClr
|
||||
//
|
||||
this.buttonConClr.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonConClr.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonConClr.Name = "buttonConClr";
|
||||
this.buttonConClr.Size = new System.Drawing.Size(75, 23);
|
||||
@ -277,36 +294,24 @@
|
||||
this.buttonConClr.UseVisualStyleBackColor = true;
|
||||
this.buttonConClr.Click += new System.EventHandler(this.buttonConClr_Click);
|
||||
//
|
||||
// groupBox4
|
||||
//
|
||||
this.groupBox4.Controls.Add(this.buttonSuperCard);
|
||||
this.groupBox4.Controls.Add(this.buttonMfcuk);
|
||||
this.groupBox4.Controls.Add(this.buttonHexTool);
|
||||
this.groupBox4.Controls.Add(this.buttonTool1);
|
||||
this.groupBox4.Location = new System.Drawing.Point(641, 101);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(169, 293);
|
||||
this.groupBox4.TabIndex = 6;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "工具";
|
||||
//
|
||||
// buttonMfcuk
|
||||
//
|
||||
this.buttonMfcuk.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonMfcuk.Location = new System.Drawing.Point(6, 126);
|
||||
this.buttonMfcuk.Location = new System.Drawing.Point(168, 24);
|
||||
this.buttonMfcuk.Name = "buttonMfcuk";
|
||||
this.buttonMfcuk.Size = new System.Drawing.Size(156, 45);
|
||||
this.buttonMfcuk.Size = new System.Drawing.Size(70, 52);
|
||||
this.buttonMfcuk.TabIndex = 3;
|
||||
this.buttonMfcuk.Text = "全加密密钥恢复\r\nMFCUK";
|
||||
this.buttonMfcuk.Text = "MFCUK\r\n爆密钥";
|
||||
this.buttonMfcuk.UseVisualStyleBackColor = true;
|
||||
this.buttonMfcuk.Click += new System.EventHandler(this.buttonMfcuk_Click);
|
||||
//
|
||||
// buttonHexTool
|
||||
//
|
||||
this.buttonHexTool.Enabled = false;
|
||||
this.buttonHexTool.Location = new System.Drawing.Point(6, 75);
|
||||
this.buttonHexTool.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonHexTool.Location = new System.Drawing.Point(6, 53);
|
||||
this.buttonHexTool.Name = "buttonHexTool";
|
||||
this.buttonHexTool.Size = new System.Drawing.Size(156, 45);
|
||||
this.buttonHexTool.Size = new System.Drawing.Size(156, 23);
|
||||
this.buttonHexTool.TabIndex = 1;
|
||||
this.buttonHexTool.Text = "Hex工具";
|
||||
this.buttonHexTool.UseVisualStyleBackColor = true;
|
||||
@ -314,9 +319,10 @@
|
||||
// buttonTool1
|
||||
//
|
||||
this.buttonTool1.Enabled = false;
|
||||
this.buttonTool1.Font = new System.Drawing.Font("宋体", 8.5F);
|
||||
this.buttonTool1.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonTool1.Name = "buttonTool1";
|
||||
this.buttonTool1.Size = new System.Drawing.Size(156, 45);
|
||||
this.buttonTool1.Size = new System.Drawing.Size(156, 23);
|
||||
this.buttonTool1.TabIndex = 0;
|
||||
this.buttonTool1.Text = "key.mfd工具";
|
||||
this.buttonTool1.UseVisualStyleBackColor = true;
|
||||
@ -329,21 +335,56 @@
|
||||
this.toolTipHelp.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
|
||||
this.toolTipHelp.ToolTipTitle = "提示";
|
||||
//
|
||||
// buttonSuperCard
|
||||
// groupBox4
|
||||
//
|
||||
this.buttonSuperCard.Location = new System.Drawing.Point(6, 177);
|
||||
this.buttonSuperCard.Name = "buttonSuperCard";
|
||||
this.buttonSuperCard.Size = new System.Drawing.Size(156, 45);
|
||||
this.buttonSuperCard.TabIndex = 4;
|
||||
this.buttonSuperCard.Text = "超级卡工具";
|
||||
this.buttonSuperCard.UseVisualStyleBackColor = true;
|
||||
this.buttonSuperCard.Click += new System.EventHandler(this.buttonSuperCard_Click);
|
||||
this.groupBox4.Controls.Add(this.buttonMfFormat);
|
||||
this.groupBox4.Controls.Add(this.buttonLockUfuid);
|
||||
this.groupBox4.Controls.Add(this.buttonCmfWrite);
|
||||
this.groupBox4.Controls.Add(this.buttonMfcuk);
|
||||
this.groupBox4.Controls.Add(this.buttonTool1);
|
||||
this.groupBox4.Controls.Add(this.buttonHexTool);
|
||||
this.groupBox4.Location = new System.Drawing.Point(12, 101);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(449, 83);
|
||||
this.groupBox4.TabIndex = 11;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "工具";
|
||||
//
|
||||
// buttonCmfWrite
|
||||
//
|
||||
this.buttonCmfWrite.Location = new System.Drawing.Point(244, 23);
|
||||
this.buttonCmfWrite.Name = "buttonCmfWrite";
|
||||
this.buttonCmfWrite.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCmfWrite.TabIndex = 4;
|
||||
this.buttonCmfWrite.Text = "CUID写";
|
||||
this.buttonCmfWrite.UseVisualStyleBackColor = true;
|
||||
this.buttonCmfWrite.Click += new System.EventHandler(this.buttonCmfWrite_Click);
|
||||
//
|
||||
// buttonLockUfuid
|
||||
//
|
||||
this.buttonLockUfuid.Location = new System.Drawing.Point(244, 52);
|
||||
this.buttonLockUfuid.Name = "buttonLockUfuid";
|
||||
this.buttonLockUfuid.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonLockUfuid.TabIndex = 5;
|
||||
this.buttonLockUfuid.Text = "锁Ufuid";
|
||||
this.buttonLockUfuid.UseVisualStyleBackColor = true;
|
||||
this.buttonLockUfuid.Click += new System.EventHandler(this.buttonLockUfuid_Click);
|
||||
//
|
||||
// buttonMfFormat
|
||||
//
|
||||
this.buttonMfFormat.Location = new System.Drawing.Point(325, 23);
|
||||
this.buttonMfFormat.Name = "buttonMfFormat";
|
||||
this.buttonMfFormat.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonMfFormat.TabIndex = 6;
|
||||
this.buttonMfFormat.Text = "清M1卡";
|
||||
this.buttonMfFormat.UseVisualStyleBackColor = true;
|
||||
this.buttonMfFormat.Click += new System.EventHandler(this.buttonMfFormat_Click);
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(835, 406);
|
||||
this.ClientSize = new System.Drawing.Size(649, 502);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
@ -385,12 +426,14 @@
|
||||
private System.Windows.Forms.Button buttonConClr;
|
||||
private System.Windows.Forms.Button buttonKill;
|
||||
private System.Windows.Forms.LinkLabel linkLabel1;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Button buttonTool1;
|
||||
private System.Windows.Forms.Button buttonHexTool;
|
||||
private System.Windows.Forms.Button buttonMfcuk;
|
||||
private System.Windows.Forms.ToolTip toolTipHelp;
|
||||
private System.Windows.Forms.Button buttonSuperCard;
|
||||
private System.Windows.Forms.GroupBox groupBox4;
|
||||
private System.Windows.Forms.Button buttonLockUfuid;
|
||||
private System.Windows.Forms.Button buttonCmfWrite;
|
||||
private System.Windows.Forms.Button buttonMfFormat;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -607,7 +607,7 @@ Text = "MifareOne Tool - 运行完毕";
|
||||
{
|
||||
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
|
||||
ProcessStartInfo psi = new ProcessStartInfo("cmd");
|
||||
psi.Arguments = "/k mfcuk.exe -v 4 -C -R -1";
|
||||
psi.Arguments = "/k mfcuk.exe -v 3 -C -R -1 -s 250 -S 250";
|
||||
psi.WorkingDirectory = "nfc-bin";
|
||||
lprocess = true;
|
||||
BackgroundWorker b = (BackgroundWorker)sender;
|
||||
@ -617,13 +617,147 @@ Text = "MifareOne Tool - 运行完毕";
|
||||
b.ReportProgress(100, "##运行完毕##");
|
||||
}
|
||||
|
||||
private void buttonSuperCard_Click(object sender, EventArgs e)
|
||||
private void buttonCmfWrite_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
|
||||
FormSuperCard fsc = new FormSuperCard(ref process);
|
||||
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
|
||||
string rmfd = "";
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
ofd.CheckFileExists = true;
|
||||
ofd.Filter = "MFD文件|*.mfd";
|
||||
ofd.Title = "请选择需要写入的MFD文件";
|
||||
ofd.Multiselect = false;
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
rmfd = ofd.FileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
string kt = "a";
|
||||
string nn = "";
|
||||
switch (MessageBox.Show("使用KeyA(是)或KeyB(否),还是不使用(用于全新白卡)(取消)?", "KeyA/B/N", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information))
|
||||
{
|
||||
case DialogResult.No:
|
||||
kt = "b";
|
||||
break;
|
||||
|
||||
case DialogResult.Cancel:
|
||||
nn = "x";
|
||||
break;
|
||||
}
|
||||
BackgroundWorker bgw = new BackgroundWorker();
|
||||
bgw.DoWork += new DoWorkEventHandler(cmf_write);
|
||||
bgw.WorkerReportsProgress = true;
|
||||
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
|
||||
bgw.RunWorkerAsync(new string[] { rmfd, kt, nn });
|
||||
}
|
||||
|
||||
void cmf_write(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
if (lprocess) { return; }
|
||||
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/nfc-mfclassic.exe");
|
||||
string[] args = (string[])e.Argument;
|
||||
psi.Arguments = "c " + args[1] + " u \"" + args[0] + "\"";
|
||||
if (keymfd != "" && args[2] == "")
|
||||
{
|
||||
psi.Arguments += " \"" + keymfd + "\" f";
|
||||
}
|
||||
psi.CreateNoWindow = true;
|
||||
psi.UseShellExecute = false;
|
||||
psi.RedirectStandardOutput = true;
|
||||
psi.RedirectStandardError = true;
|
||||
lprocess = true;
|
||||
fsc.ShowDialog();
|
||||
BackgroundWorker b = (BackgroundWorker)sender;
|
||||
process = Process.Start(psi);
|
||||
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;
|
||||
b.ReportProgress(100, "##运行完毕##");
|
||||
}
|
||||
|
||||
private void buttonLockUfuid_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
|
||||
if (MessageBox.Show("该操作将会锁死UFUID卡片!!!\n锁死后不可恢复!无法再次更改0块!请确认是否要继续操作?", "危险操作警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel)
|
||||
{ return; }
|
||||
BackgroundWorker bgw = new BackgroundWorker();
|
||||
bgw.DoWork += new DoWorkEventHandler(lock_ufuid);
|
||||
bgw.WorkerReportsProgress = true;
|
||||
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
|
||||
bgw.RunWorkerAsync();
|
||||
}
|
||||
|
||||
void lock_ufuid(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
if (lprocess) { return; }
|
||||
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/nfc-mfsetuid.exe");
|
||||
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
|
||||
byte[] uid = new byte[4];
|
||||
rng.GetNonZeroBytes(uid);
|
||||
psi.Arguments = "-l";
|
||||
psi.CreateNoWindow = true;
|
||||
psi.UseShellExecute = false;
|
||||
psi.RedirectStandardOutput = true;
|
||||
psi.RedirectStandardError = true;
|
||||
lprocess = true;
|
||||
BackgroundWorker b = (BackgroundWorker)sender;
|
||||
process = Process.Start(psi);
|
||||
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;
|
||||
b.ReportProgress(100, "##运行完毕##");
|
||||
}
|
||||
|
||||
private void buttonMfFormat_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
|
||||
if (keymfd=="") { MessageBox.Show("未选择有效key.mfd。", "无密钥", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
|
||||
string rmfd = keymfd;
|
||||
string kt = "a";
|
||||
switch (MessageBox.Show("使用KeyA(是)或KeyB(否)?", "KeyA/B", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
|
||||
{
|
||||
case DialogResult.No:
|
||||
kt = "b";
|
||||
break;
|
||||
}
|
||||
BackgroundWorker bgw = new BackgroundWorker();
|
||||
bgw.DoWork += new DoWorkEventHandler(mf_format);
|
||||
bgw.WorkerReportsProgress = true;
|
||||
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
|
||||
bgw.RunWorkerAsync(new string[] { rmfd, kt});
|
||||
}
|
||||
|
||||
void mf_format(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
if (lprocess) { return; }
|
||||
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/nfc-mfclassic.exe");
|
||||
string[] args = (string[])e.Argument;
|
||||
psi.Arguments = "f " + args[1] + " u \"" + args[0] + "\"";
|
||||
psi.Arguments += " \"" + keymfd + "\" f";
|
||||
psi.CreateNoWindow = true;
|
||||
psi.UseShellExecute = false;
|
||||
psi.RedirectStandardOutput = true;
|
||||
psi.RedirectStandardError = true;
|
||||
lprocess = true;
|
||||
BackgroundWorker b = (BackgroundWorker)sender;
|
||||
process = Process.Start(psi);
|
||||
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;
|
||||
b.ReportProgress(100, "##运行完毕##");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,4 @@
|
||||
<metadata name="toolTipHelp.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTipHelp.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
130
MifareOneTool/FormSuperCard.Designer.cs
generated
130
MifareOneTool/FormSuperCard.Designer.cs
generated
@ -1,130 +0,0 @@
|
||||
namespace MifareOneTool
|
||||
{
|
||||
partial class FormSuperCard
|
||||
{
|
||||
/// <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.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.buttonWriteCFuid = new System.Windows.Forms.Button();
|
||||
this.buttonLockUfuid = new System.Windows.Forms.Button();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.buttonExit = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.buttonWriteCFuid);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(258, 67);
|
||||
this.groupBox1.TabIndex = 0;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "CUID/FUID写入";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.buttonLockUfuid);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 85);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(258, 67);
|
||||
this.groupBox2.TabIndex = 0;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "UFUID封卡";
|
||||
//
|
||||
// buttonWriteCFuid
|
||||
//
|
||||
this.buttonWriteCFuid.Enabled = false;
|
||||
this.buttonWriteCFuid.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonWriteCFuid.Name = "buttonWriteCFuid";
|
||||
this.buttonWriteCFuid.Size = new System.Drawing.Size(246, 30);
|
||||
this.buttonWriteCFuid.TabIndex = 0;
|
||||
this.buttonWriteCFuid.Text = "执行!";
|
||||
this.buttonWriteCFuid.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonLockUfuid
|
||||
//
|
||||
this.buttonLockUfuid.Enabled = false;
|
||||
this.buttonLockUfuid.Location = new System.Drawing.Point(6, 24);
|
||||
this.buttonLockUfuid.Name = "buttonLockUfuid";
|
||||
this.buttonLockUfuid.Size = new System.Drawing.Size(246, 30);
|
||||
this.buttonLockUfuid.TabIndex = 1;
|
||||
this.buttonLockUfuid.Text = "执行!";
|
||||
this.buttonLockUfuid.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.BackColor = System.Drawing.Color.Black;
|
||||
this.richTextBox1.ForeColor = System.Drawing.Color.Lime;
|
||||
this.richTextBox1.Location = new System.Drawing.Point(12, 158);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.ReadOnly = true;
|
||||
this.richTextBox1.Size = new System.Drawing.Size(258, 323);
|
||||
this.richTextBox1.TabIndex = 1;
|
||||
this.richTextBox1.Text = "等待中……\n";
|
||||
//
|
||||
// buttonExit
|
||||
//
|
||||
this.buttonExit.Location = new System.Drawing.Point(189, 487);
|
||||
this.buttonExit.Name = "buttonExit";
|
||||
this.buttonExit.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonExit.TabIndex = 2;
|
||||
this.buttonExit.Text = "退出";
|
||||
this.buttonExit.UseVisualStyleBackColor = true;
|
||||
this.buttonExit.Click += new System.EventHandler(this.buttonExit_Click);
|
||||
//
|
||||
// FormSuperCard
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(282, 522);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.buttonExit);
|
||||
this.Controls.Add(this.richTextBox1);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.Name = "FormSuperCard";
|
||||
this.Text = "超级卡工具";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Button buttonWriteCFuid;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button buttonLockUfuid;
|
||||
private System.Windows.Forms.RichTextBox richTextBox1;
|
||||
private System.Windows.Forms.Button buttonExit;
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
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.Diagnostics;
|
||||
|
||||
namespace MifareOneTool
|
||||
{
|
||||
public partial class FormSuperCard : Form
|
||||
{
|
||||
public FormSuperCard(ref Process pro)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.pro = pro;
|
||||
}
|
||||
|
||||
Process pro;
|
||||
|
||||
private void buttonExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,120 +0,0 @@
|
||||
<?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>
|
||||
@ -79,12 +79,6 @@
|
||||
<Compile Include="FormKeyMfd.Designer.cs">
|
||||
<DependentUpon>FormKeyMfd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="FormSuperCard.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FormSuperCard.Designer.cs">
|
||||
<DependentUpon>FormSuperCard.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GitHubUpdate.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -94,9 +88,6 @@
|
||||
<EmbeddedResource Include="FormKeyMfd.resx">
|
||||
<DependentUpon>FormKeyMfd.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="FormSuperCard.resx">
|
||||
<DependentUpon>FormSuperCard.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.3.1.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.1.0")]
|
||||
[assembly: AssemblyVersion("1.3.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.3.2.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user