修复字典测试后无法保存问题
修复字典测试字典路径有空格出错问题
加入MFF08工具
添加多处提示
This commit is contained in:
XAS-712 2019-05-01 22:34:09 +08:00
parent 5b6f8193d3
commit 839992040b
8 changed files with 545 additions and 29 deletions

View File

@ -60,6 +60,7 @@
this.buttonDictMfoc = new System.Windows.Forms.Button();
this.buttonnKeysMfoc = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.buttonMFF08 = new System.Windows.Forms.Button();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.buttonEStop = new System.Windows.Forms.Button();
@ -203,7 +204,7 @@
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(576, 313);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "Hello,cardman!\n建议点击\"检测\"以加快后续运行速度\n";
this.richTextBox1.Text = "Hello,cardman!\n首次运行建议点击\"检测设备\"以加快后续运行速度\n";
//
// buttonMfRead
//
@ -510,6 +511,7 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.buttonMFF08);
this.groupBox4.Controls.Add(this.buttonDiffTool);
this.groupBox4.Controls.Add(this.buttonHexTool);
this.groupBox4.Location = new System.Drawing.Point(2, 75);
@ -521,6 +523,16 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "集成辅助工具";
//
// buttonMFF08
//
this.buttonMFF08.Location = new System.Drawing.Point(90, 16);
this.buttonMFF08.Name = "buttonMFF08";
this.buttonMFF08.Size = new System.Drawing.Size(117, 25);
this.buttonMFF08.TabIndex = 2;
this.buttonMFF08.Text = "MFF08 CUID修复";
this.buttonMFF08.UseVisualStyleBackColor = true;
this.buttonMFF08.Click += new System.EventHandler(this.buttonMFF08_Click);
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage2);
@ -919,7 +931,7 @@
this.groupBox14.Margin = new System.Windows.Forms.Padding(2);
this.groupBox14.Name = "groupBox14";
this.groupBox14.Padding = new System.Windows.Forms.Padding(2);
this.groupBox14.Size = new System.Drawing.Size(142, 142);
this.groupBox14.Size = new System.Drawing.Size(142, 140);
this.groupBox14.TabIndex = 15;
this.groupBox14.TabStop = false;
this.groupBox14.Text = "优化设置";
@ -1366,6 +1378,7 @@
private System.Windows.Forms.CheckBox checkBoxMultiDev;
private System.Windows.Forms.ToolStripStatusLabel curDevice;
private System.Windows.Forms.CheckBox checkBoxCuidKeyOver;
private System.Windows.Forms.Button buttonMFF08;
}
}

View File

@ -55,6 +55,7 @@ namespace MifareOneTool
if (e.ProgressPercentage == 100)
{
logAppend((string)e.UserState);
logAppend("");
Text = "MifareOne Tool - 运行完毕";
}
else if (e.ProgressPercentage == 101)
@ -112,6 +113,7 @@ namespace MifareOneTool
}
}
omfd = "";
logAppend("");
Text = "MifareOne Tool - 运行完毕";
}
else if (e.ProgressPercentage == 102)
@ -119,6 +121,7 @@ namespace MifareOneTool
logAppend((string)e.UserState);
logAppend("##Nonce收集完毕##");
logAppend("您可以上传到云计算服务节点进行计算。");
logAppend("");
Text = "MifareOne Tool - 运行完毕";
}
@ -138,13 +141,17 @@ namespace MifareOneTool
SetDeviceCombo.Items.AddRange(myReaders.ToArray());
SetDeviceCombo.SelectedIndex = 0;
}
else
{
logAppend("没有发现任何有效的NFC设备。");
logAppend("请检查接线是否正确/驱动是否正常安装/设备电源是否已经打开(对于具有电源开关的型号)。");
}
}
else
{
logAppend((string)e.UserState);
}
Application.DoEvents();
}
private void logAppend(string msg)
@ -163,7 +170,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行检测设备……"); running = true;
List<string> myReader = new List<string>();
process.OutputDataReceived += (s, _e) =>
{
@ -195,9 +203,6 @@ namespace MifareOneTool
{
logAppend("#软件版本 " + Assembly.GetExecutingAssembly().GetName().Version.ToString());
localVersionLabel.Text = "本地版本 " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
//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;
@ -250,7 +255,9 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0,"开始执行扫描卡片……");
running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -370,7 +377,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行读取卡片……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -502,7 +510,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行写入M1卡片……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -558,7 +567,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行MFOC解密……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -612,7 +622,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行重置UID卡片卡号……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -649,7 +660,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行UID卡片全格……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -688,7 +700,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行UID卡片读取……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -747,7 +760,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行UID卡片写入……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -803,7 +817,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行UID卡片设定卡号……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -834,6 +849,7 @@ namespace MifareOneTool
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行全加密卡片爆破……");
process.WaitForExit();
lprocess = false; running = false;
b.ReportProgress(100, "##运行完毕##");
@ -911,7 +927,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行CUID/FUID卡片写入……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -960,14 +977,15 @@ namespace MifareOneTool
RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
byte[] uid = new byte[4];
rng.GetNonZeroBytes(uid);
psi.Arguments = "-l";
psi.Arguments = "-q -l";
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 = Process.Start(psi);
b.ReportProgress(0, "开始执行UFUID卡片锁定……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -1018,7 +1036,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行格式化M1卡片……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -1179,7 +1198,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行检测卡片加密……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -1274,7 +1294,7 @@ namespace MifareOneTool
return;
}
string rmfd = "Mfoc.tmp";
string key = "-f " + filename + " ";
string key = "-f \"" + filename + "\" ";
if (checkBoxAutoSave.Checked)
{
lastuid = GetUID();
@ -1301,10 +1321,11 @@ namespace MifareOneTool
psi.Arguments = "/T:0A " + args[2] + @" nfc-bin\mfoc.exe " + args[1] + " -O \"" + args[0] + "\"";
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行字典模式MFOC解密……"); running = true;
process.WaitForExit();
lprocess = false; running = false;
if (process.ExitCode == 0)
if (process.ExitCode == -1073741510) //Why this
{
b.ReportProgress(101, "##运行完毕##");
}
@ -1376,7 +1397,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行HardNested解密强化卡……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -1405,7 +1427,8 @@ namespace MifareOneTool
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
process = Process.Start(psi); running = true;
process = Process.Start(psi);
b.ReportProgress(0, "开始执行HardNested收集数据……"); running = true;
process.OutputDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
process.ErrorDataReceived += (s, _e) => b.ReportProgress(0, _e.Data);
//StreamReader stderr = process.StandardError;
@ -1495,5 +1518,11 @@ namespace MifareOneTool
{
Properties.Settings.Default.CuidKeyOver = checkBoxCuidKeyOver.Checked;
}
private void buttonMFF08_Click(object sender, EventArgs e)
{
FormMFF08 mff08 = new FormMFF08();
mff08.ShowDialog();
}
}
}

View File

@ -120,6 +120,9 @@
<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>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>157, 17</value>
</metadata>

202
MifareOneTool/FormMFF08.Designer.cs generated Normal file
View File

@ -0,0 +1,202 @@
namespace MifareOneTool
{
partial class FormMFF08
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMFF08));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.buttonClr = new System.Windows.Forms.Button();
this.buttonLoadKey = new System.Windows.Forms.Button();
this.keyfileBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.buttonKeyWrite = new System.Windows.Forms.Button();
this.buttonWriteEmpty = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.logBox = new System.Windows.Forms.RichTextBox();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(635, 100);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "说明";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 9.5F);
this.label1.ForeColor = System.Drawing.Color.Blue;
this.label1.Location = new System.Drawing.Point(6, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(584, 39);
this.label1.TabIndex = 0;
this.label1.Text = "本工具由nfc-mfclassic做少许修改而来。可用于1K大小CUID卡0块损坏的修复。\r\n本工具可以修复SAK写错不认卡类型、ATQA写错不认卡大小" +
"对于BCC写错暂时无能为力。\r\n请准备好你最后一次写入该卡导致0块损坏的卡数据文件如果卡片有加密。";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.buttonClr);
this.groupBox2.Controls.Add(this.buttonLoadKey);
this.groupBox2.Controls.Add(this.keyfileBox);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.buttonKeyWrite);
this.groupBox2.Controls.Add(this.buttonWriteEmpty);
this.groupBox2.Location = new System.Drawing.Point(12, 118);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(635, 100);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "操作";
//
// buttonClr
//
this.buttonClr.Location = new System.Drawing.Point(585, 33);
this.buttonClr.Name = "buttonClr";
this.buttonClr.Size = new System.Drawing.Size(44, 23);
this.buttonClr.TabIndex = 4;
this.buttonClr.Text = "清除";
this.buttonClr.UseVisualStyleBackColor = true;
this.buttonClr.Click += new System.EventHandler(this.buttonClr_Click);
//
// buttonLoadKey
//
this.buttonLoadKey.Location = new System.Drawing.Point(504, 33);
this.buttonLoadKey.Name = "buttonLoadKey";
this.buttonLoadKey.Size = new System.Drawing.Size(75, 23);
this.buttonLoadKey.TabIndex = 1;
this.buttonLoadKey.Text = "加载…";
this.buttonLoadKey.UseVisualStyleBackColor = true;
this.buttonLoadKey.Click += new System.EventHandler(this.buttonLoadKey_Click);
//
// keyfileBox
//
this.keyfileBox.Location = new System.Drawing.Point(237, 35);
this.keyfileBox.Name = "keyfileBox";
this.keyfileBox.Size = new System.Drawing.Size(261, 21);
this.keyfileBox.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(235, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(227, 12);
this.label2.TabIndex = 2;
this.label2.Text = "最后一次写卡导致0块损坏的卡数据文件";
//
// buttonKeyWrite
//
this.buttonKeyWrite.Font = new System.Drawing.Font("宋体", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonKeyWrite.Location = new System.Drawing.Point(121, 20);
this.buttonKeyWrite.Name = "buttonKeyWrite";
this.buttonKeyWrite.Size = new System.Drawing.Size(83, 74);
this.buttonKeyWrite.TabIndex = 1;
this.buttonKeyWrite.Text = "修复写入\r\n有密码\r\nCUID卡";
this.buttonKeyWrite.UseVisualStyleBackColor = true;
this.buttonKeyWrite.Click += new System.EventHandler(this.buttonKeyWrite_Click);
//
// buttonWriteEmpty
//
this.buttonWriteEmpty.Font = new System.Drawing.Font("宋体", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonWriteEmpty.Location = new System.Drawing.Point(8, 20);
this.buttonWriteEmpty.Name = "buttonWriteEmpty";
this.buttonWriteEmpty.Size = new System.Drawing.Size(83, 74);
this.buttonWriteEmpty.TabIndex = 0;
this.buttonWriteEmpty.Text = "修复写入\r\n无密空白\r\nCUID卡";
this.buttonWriteEmpty.UseVisualStyleBackColor = true;
this.buttonWriteEmpty.Click += new System.EventHandler(this.buttonWriteEmpty_Click);
//
// groupBox3
//
this.groupBox3.Controls.Add(this.logBox);
this.groupBox3.Location = new System.Drawing.Point(12, 224);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(635, 188);
this.groupBox3.TabIndex = 0;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "日志";
//
// logBox
//
this.logBox.BackColor = System.Drawing.Color.Black;
this.logBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logBox.ForeColor = System.Drawing.Color.Gold;
this.logBox.Location = new System.Drawing.Point(3, 17);
this.logBox.Name = "logBox";
this.logBox.ReadOnly = true;
this.logBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedVertical;
this.logBox.Size = new System.Drawing.Size(629, 168);
this.logBox.TabIndex = 0;
this.logBox.Text = resources.GetString("logBox.Text");
//
// FormMFF08
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(659, 424);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "FormMFF08";
this.Text = "MFF08 Tool-CUID修复工具";
this.Load += new System.EventHandler(this.FormMFF08_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button buttonLoadKey;
private System.Windows.Forms.TextBox keyfileBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button buttonKeyWrite;
private System.Windows.Forms.Button buttonWriteEmpty;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.RichTextBox logBox;
private System.Windows.Forms.Button buttonClr;
}
}

132
MifareOneTool/FormMFF08.cs Normal file
View File

@ -0,0 +1,132 @@
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;
using System.IO;
namespace MifareOneTool
{
public partial class FormMFF08 : Form
{
public FormMFF08()
{
InitializeComponent();
}
private void buttonLoadKey_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.CheckFileExists = true;
ofd.Filter = "MFD文件|*.mfd|DUMP文件|*.dump";
ofd.Title = "请选择最后一次写卡导致0块损坏的卡数据文件";
ofd.Multiselect = false;
if (ofd.ShowDialog() == DialogResult.OK)
{
keyfileBox.Text = ofd.FileName;
}
}
private void buttonClr_Click(object sender, EventArgs e)
{
keyfileBox.Text = "";
}
bool lprocess = false;
Process process;
private void logAppend(string msg)
{
logBox.AppendText(msg + "\n");
logBox.ScrollToCaret();
}
void default_rpt(object sender, ProgressChangedEventArgs e)
{
if (e.ProgressPercentage == 100)
{
logAppend((string)e.UserState);
groupBox2.Enabled = true;
}
else if (e.ProgressPercentage == 1)
{
groupBox2.Enabled = false;
}
else
{
logAppend((string)e.UserState);
}
Application.DoEvents();
}
private void buttonWriteEmpty_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
S50 empty = new S50();
empty.ExportToMfd("mff08_empty.kmf");
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(cmf_write);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(new string[] { "mff08_empty.kmf", "A", "x", "" });
}
void cmf_write(object sender, DoWorkEventArgs e)
{
if (lprocess) { return; }
ProcessStartInfo psi = new ProcessStartInfo("nfc-bin/mff08.exe");
string[] args = (string[])e.Argument;
psi.Arguments = "c " + args[1] + " u \"" + args[0] + "\"";
if (args[3] != "" && args[2] == "")
{
psi.Arguments += " \"" + args[3] + "\" f";
}
psi.CreateNoWindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
lprocess = true;
BackgroundWorker b = (BackgroundWorker)sender;
b.ReportProgress(1);
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 buttonKeyWrite_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
S50 empty = new S50();
empty.ExportToMfd("mff08_empty.kmf");
if (keyfileBox.Text == "")
{
MessageBox.Show("您没有给定最后一次写卡导致0块损坏的卡数据文件来作为写卡时的密钥源。\n操作终止。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(cmf_write);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(new string[] { "mff08_empty.kmf", "C", "", keyfileBox.Text });
}
private void FormMFF08_Load(object sender, EventArgs e)
{
if (!File.Exists("nfc-bin/mff08.exe"))
{
MessageBox.Show("无法找到MFF08程序文件。\n操作终止。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -0,0 +1,128 @@
<?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>
<data name="logBox.Text" xml:space="preserve">
<value>每个人使用CUID卡的时候总会因不了解或是不经意犯下一些小错误。
比如使用编辑器修改UID却没有改BCCSAK=28的卡片解密后的文件直接写入又或是从S70卡片导入数据写入1K卡却没有更正ATQA。
MFF08工具给了你一次修复这些损坏卡片的机会。
------------------------------------------------------------------------
</value>
</data>
</root>

View File

@ -95,6 +95,12 @@
<Compile Include="FormHTool.Designer.cs">
<DependentUpon>FormHTool.cs</DependentUpon>
</Compile>
<Compile Include="FormMFF08.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMFF08.Designer.cs">
<DependentUpon>FormMFF08.cs</DependentUpon>
</Compile>
<Compile Include="GitHubUpdate.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -110,6 +116,9 @@
<EmbeddedResource Include="FormHTool.resx">
<DependentUpon>FormHTool.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormMFF08.resx">
<DependentUpon>FormMFF08.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.7.0")]
[assembly: AssemblyFileVersion("1.6.7.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]