优化S50数据结构,增加排重

This commit is contained in:
XAS-712 2019-01-21 23:41:33 +08:00
parent 3f0fb90813
commit 217c6974db
10 changed files with 341 additions and 72 deletions

View File

@ -227,6 +227,21 @@ namespace MifareOneTool
} }
return info; return info;
} }
public byte[] KeyA
{
get { return this._sector[3].Skip(0).Take(6).ToArray(); }
set { for (int i = 0; i < 6; i++) { this._sector[3][i] = value[i]; } }
}
public byte[] KeyB
{
get { return this._sector[3].Skip(10).Take(6).ToArray(); }
set { for (int i = 10; i < 16; i++) { this._sector[3][i] = value[i]; } }
}
public byte[] ACBits
{
get { return this._sector[3].Skip(6).Take(4).ToArray(); }
set { for (int i = 6; i < 10; i++) { this._sector[3][i] = value[i]; } }
}
} }
class S50 class S50
{ {
@ -337,5 +352,27 @@ namespace MifareOneTool
} }
File.WriteAllText(file, sb.ToString()); File.WriteAllText(file, sb.ToString());
} }
public List<byte[]> KeyList()
{
List<byte[]> keys = new List<byte[]>();
foreach (Sector s in this._sectors)
{
keys.Add(s.KeyA);
keys.Add(s.KeyB);
}
keys = keys.Distinct().ToList();
return keys;
}
public List<string> KeyListStr()
{
List<string> keys = new List<string>();
foreach (Sector s in this._sectors)
{
keys.Add(Utils.Hex2Str(s.KeyA));
keys.Add(Utils.Hex2Str(s.KeyB));
}
keys = keys.Distinct().ToList();
return keys;
}
} }
} }

View File

@ -51,9 +51,10 @@
this.buttonConClr = new System.Windows.Forms.Button(); this.buttonConClr = new System.Windows.Forms.Button();
this.buttonMfcuk = new System.Windows.Forms.Button(); this.buttonMfcuk = new System.Windows.Forms.Button();
this.buttonHexTool = new System.Windows.Forms.Button(); this.buttonHexTool = new System.Windows.Forms.Button();
this.buttonTool1 = new System.Windows.Forms.Button(); this.buttonDiffTool = new System.Windows.Forms.Button();
this.toolTipHelp = new System.Windows.Forms.ToolTip(this.components); this.toolTipHelp = new System.Windows.Forms.ToolTip(this.components);
this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox();
this.buttonCheckEncrypt = new System.Windows.Forms.Button();
this.buttonEnAcr122u = new System.Windows.Forms.Button(); this.buttonEnAcr122u = new System.Windows.Forms.Button();
this.buttonMfFormat = new System.Windows.Forms.Button(); this.buttonMfFormat = new System.Windows.Forms.Button();
this.buttonLockUfuid = new System.Windows.Forms.Button(); this.buttonLockUfuid = new System.Windows.Forms.Button();
@ -67,6 +68,7 @@
this.button4 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button();
this.buttonEMfWrite = new System.Windows.Forms.Button(); this.buttonEMfWrite = new System.Windows.Forms.Button();
this.groupBox6 = new System.Windows.Forms.GroupBox(); this.groupBox6 = new System.Windows.Forms.GroupBox();
this.buttonECheckEncrypt = new System.Windows.Forms.Button();
this.buttonEUpdate = new System.Windows.Forms.Button(); this.buttonEUpdate = new System.Windows.Forms.Button();
this.buttoEScanCard = new System.Windows.Forms.Button(); this.buttoEScanCard = new System.Windows.Forms.Button();
this.buttonEscan = new System.Windows.Forms.Button(); this.buttonEscan = new System.Windows.Forms.Button();
@ -82,8 +84,6 @@
this.localVersionLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.localVersionLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.remoteVersionLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.remoteVersionLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.buttonCheckEncrypt = new System.Windows.Forms.Button();
this.buttonECheckEncrypt = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
@ -346,20 +346,20 @@
this.buttonHexTool.Name = "buttonHexTool"; this.buttonHexTool.Name = "buttonHexTool";
this.buttonHexTool.Size = new System.Drawing.Size(110, 23); this.buttonHexTool.Size = new System.Drawing.Size(110, 23);
this.buttonHexTool.TabIndex = 1; this.buttonHexTool.TabIndex = 1;
this.buttonHexTool.Text = "Hex工具"; this.buttonHexTool.Text = "Hex编辑器";
this.buttonHexTool.UseVisualStyleBackColor = true; this.buttonHexTool.UseVisualStyleBackColor = true;
this.buttonHexTool.Click += new System.EventHandler(this.buttonHexTool_Click); this.buttonHexTool.Click += new System.EventHandler(this.buttonHexTool_Click);
// //
// buttonTool1 // buttonDiffTool
// //
this.buttonTool1.Enabled = false; this.buttonDiffTool.Enabled = false;
this.buttonTool1.Font = new System.Drawing.Font("宋体", 8.5F); this.buttonDiffTool.Font = new System.Drawing.Font("宋体", 8.5F);
this.buttonTool1.Location = new System.Drawing.Point(6, 24); this.buttonDiffTool.Location = new System.Drawing.Point(6, 24);
this.buttonTool1.Name = "buttonTool1"; this.buttonDiffTool.Name = "buttonDiffTool";
this.buttonTool1.Size = new System.Drawing.Size(110, 23); this.buttonDiffTool.Size = new System.Drawing.Size(110, 23);
this.buttonTool1.TabIndex = 0; this.buttonDiffTool.TabIndex = 0;
this.buttonTool1.Text = "key.mfd工具"; this.buttonDiffTool.Text = "差异比较";
this.buttonTool1.UseVisualStyleBackColor = true; this.buttonDiffTool.UseVisualStyleBackColor = true;
// //
// toolTipHelp // toolTipHelp
// //
@ -377,7 +377,7 @@
this.groupBox4.Controls.Add(this.buttonLockUfuid); this.groupBox4.Controls.Add(this.buttonLockUfuid);
this.groupBox4.Controls.Add(this.buttonCmfWrite); this.groupBox4.Controls.Add(this.buttonCmfWrite);
this.groupBox4.Controls.Add(this.buttonMfcuk); this.groupBox4.Controls.Add(this.buttonMfcuk);
this.groupBox4.Controls.Add(this.buttonTool1); this.groupBox4.Controls.Add(this.buttonDiffTool);
this.groupBox4.Controls.Add(this.buttonHexTool); this.groupBox4.Controls.Add(this.buttonHexTool);
this.groupBox4.Location = new System.Drawing.Point(3, 95); this.groupBox4.Location = new System.Drawing.Point(3, 95);
this.groupBox4.Name = "groupBox4"; this.groupBox4.Name = "groupBox4";
@ -386,6 +386,16 @@
this.groupBox4.TabStop = false; this.groupBox4.TabStop = false;
this.groupBox4.Text = "工具"; this.groupBox4.Text = "工具";
// //
// buttonCheckEncrypt
//
this.buttonCheckEncrypt.Location = new System.Drawing.Point(360, 23);
this.buttonCheckEncrypt.Name = "buttonCheckEncrypt";
this.buttonCheckEncrypt.Size = new System.Drawing.Size(75, 23);
this.buttonCheckEncrypt.TabIndex = 13;
this.buttonCheckEncrypt.Text = "检加密";
this.buttonCheckEncrypt.UseVisualStyleBackColor = true;
this.buttonCheckEncrypt.Click += new System.EventHandler(this.buttonCheckEncrypt_Click);
//
// buttonEnAcr122u // buttonEnAcr122u
// //
this.buttonEnAcr122u.Location = new System.Drawing.Point(279, 52); this.buttonEnAcr122u.Location = new System.Drawing.Point(279, 52);
@ -525,6 +535,16 @@
this.groupBox6.TabStop = false; this.groupBox6.TabStop = false;
this.groupBox6.Text = "[1]检测"; this.groupBox6.Text = "[1]检测";
// //
// buttonECheckEncrypt
//
this.buttonECheckEncrypt.Location = new System.Drawing.Point(6, 87);
this.buttonECheckEncrypt.Name = "buttonECheckEncrypt";
this.buttonECheckEncrypt.Size = new System.Drawing.Size(116, 25);
this.buttonECheckEncrypt.TabIndex = 5;
this.buttonECheckEncrypt.Text = "[3]检测加密";
this.buttonECheckEncrypt.UseVisualStyleBackColor = true;
this.buttonECheckEncrypt.Click += new System.EventHandler(this.buttonECheckEncrypt_Click);
//
// buttonEUpdate // buttonEUpdate
// //
this.buttonEUpdate.Location = new System.Drawing.Point(6, 140); this.buttonEUpdate.Location = new System.Drawing.Point(6, 140);
@ -667,26 +687,6 @@
this.timer1.Enabled = true; this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
// //
// buttonCheckEncrypt
//
this.buttonCheckEncrypt.Location = new System.Drawing.Point(360, 23);
this.buttonCheckEncrypt.Name = "buttonCheckEncrypt";
this.buttonCheckEncrypt.Size = new System.Drawing.Size(75, 23);
this.buttonCheckEncrypt.TabIndex = 13;
this.buttonCheckEncrypt.Text = "检加密";
this.buttonCheckEncrypt.UseVisualStyleBackColor = true;
this.buttonCheckEncrypt.Click += new System.EventHandler(this.buttonCheckEncrypt_Click);
//
// buttonECheckEncrypt
//
this.buttonECheckEncrypt.Location = new System.Drawing.Point(6, 87);
this.buttonECheckEncrypt.Name = "buttonECheckEncrypt";
this.buttonECheckEncrypt.Size = new System.Drawing.Size(116, 25);
this.buttonECheckEncrypt.TabIndex = 5;
this.buttonECheckEncrypt.Text = "[3]检测加密";
this.buttonECheckEncrypt.UseVisualStyleBackColor = true;
this.buttonECheckEncrypt.Click += new System.EventHandler(this.buttonECheckEncrypt_Click);
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@ -740,7 +740,7 @@
private System.Windows.Forms.Button buttonConClr; private System.Windows.Forms.Button buttonConClr;
private System.Windows.Forms.Button buttonKill; private System.Windows.Forms.Button buttonKill;
private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Button buttonTool1; private System.Windows.Forms.Button buttonDiffTool;
private System.Windows.Forms.Button buttonHexTool; private System.Windows.Forms.Button buttonHexTool;
private System.Windows.Forms.Button buttonMfcuk; private System.Windows.Forms.Button buttonMfcuk;
private System.Windows.Forms.ToolTip toolTipHelp; private System.Windows.Forms.ToolTip toolTipHelp;

View File

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

58
MifareOneTool/FormDiff.Designer.cs generated Normal file
View File

@ -0,0 +1,58 @@
namespace MifareOneTool
{
partial class FormDiff
{
/// <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.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(12, 43);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(421, 505);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "A: 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11";
//
// FormDiff
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(445, 560);
this.Controls.Add(this.richTextBox1);
this.Name = "FormDiff";
this.Text = "FormDiff";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RichTextBox richTextBox1;
}
}

19
MifareOneTool/FormDiff.cs Normal file
View File

@ -0,0 +1,19 @@
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;
namespace MifareOneTool
{
public partial class FormDiff : Form
{
public FormDiff()
{
InitializeComponent();
}
}
}

120
MifareOneTool/FormDiff.resx Normal file
View 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>

View File

@ -39,7 +39,11 @@
this.退ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.退ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.UIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.UIDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.MCT格式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -67,10 +71,7 @@
this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox3 = new System.Windows.Forms.GroupBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.s50BindingSource = new System.Windows.Forms.BindingSource(this.components); this.s50BindingSource = new System.Windows.Forms.BindingSource(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.MCT格式ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
@ -157,7 +158,8 @@
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.ToolStripMenuItem, this.ToolStripMenuItem,
this.toolStripSeparator3, this.toolStripSeparator3,
this.MCT格式ToolStripMenuItem}); this.MCT格式ToolStripMenuItem,
this.ToolStripMenuItem});
this.ToolStripMenuItem.Name = "工具ToolStripMenuItem"; this.ToolStripMenuItem.Name = "工具ToolStripMenuItem";
this.ToolStripMenuItem.Size = new System.Drawing.Size(51, 24); this.ToolStripMenuItem.Size = new System.Drawing.Size(51, 24);
this.ToolStripMenuItem.Text = "工具"; this.ToolStripMenuItem.Text = "工具";
@ -166,18 +168,44 @@
// //
this.UIDToolStripMenuItem.Name = "修改UIDToolStripMenuItem"; this.UIDToolStripMenuItem.Name = "修改UIDToolStripMenuItem";
this.UIDToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U))); this.UIDToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
this.UIDToolStripMenuItem.Size = new System.Drawing.Size(239, 24); this.UIDToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.UIDToolStripMenuItem.Text = "修改UID"; this.UIDToolStripMenuItem.Text = "修改UID";
this.UIDToolStripMenuItem.Click += new System.EventHandler(this.UIDToolStripMenuItem_Click); this.UIDToolStripMenuItem.Click += new System.EventHandler(this.UIDToolStripMenuItem_Click);
// //
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(245, 6);
//
// 检查全卡ToolStripMenuItem // 检查全卡ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "检查全卡ToolStripMenuItem"; this.ToolStripMenuItem.Name = "检查全卡ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.J))); this.ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.J)));
this.ToolStripMenuItem.Size = new System.Drawing.Size(239, 24); this.ToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.ToolStripMenuItem.Text = "检查全卡"; this.ToolStripMenuItem.Text = "检查全卡";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// 检查并纠正全卡ToolStripMenuItem
//
this.ToolStripMenuItem.Name = "检查并纠正全卡ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K)));
this.ToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.ToolStripMenuItem.Text = "检查并纠正全卡";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(245, 6);
//
// 导出为MCT格式ToolStripMenuItem
//
this.MCT格式ToolStripMenuItem.Name = "导出为MCT格式ToolStripMenuItem";
this.MCT格式ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M)));
this.MCT格式ToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.MCT格式ToolStripMenuItem.Text = "导出为MCT格式";
this.MCT格式ToolStripMenuItem.Click += new System.EventHandler(this.MCT格式ToolStripMenuItem_Click);
//
// groupBox1 // groupBox1
// //
this.groupBox1.Controls.Add(this.dataGridView1); this.groupBox1.Controls.Add(this.dataGridView1);
@ -492,31 +520,13 @@
// //
this.s50BindingSource.DataSource = typeof(MifareOneTool.S50); this.s50BindingSource.DataSource = typeof(MifareOneTool.S50);
// //
// 检查并纠正全卡ToolStripMenuItem // 导出密钥字典ToolStripMenuItem
// //
this.ToolStripMenuItem.Name = "检查并纠正全卡ToolStripMenuItem"; this.ToolStripMenuItem.Name = "导出密钥字典ToolStripMenuItem";
this.ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K))); this.ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.ToolStripMenuItem.Size = new System.Drawing.Size(239, 24); this.ToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.ToolStripMenuItem.Text = "检查并纠正全卡"; this.ToolStripMenuItem.Text = "导出密钥字典";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(245, 6);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(245, 6);
//
// 导出为MCT格式ToolStripMenuItem
//
this.MCT格式ToolStripMenuItem.Name = "导出为MCT格式ToolStripMenuItem";
this.MCT格式ToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M)));
this.MCT格式ToolStripMenuItem.Size = new System.Drawing.Size(248, 24);
this.MCT格式ToolStripMenuItem.Text = "导出为MCT格式";
this.MCT格式ToolStripMenuItem.Click += new System.EventHandler(this.MCT格式ToolStripMenuItem_Click);
// //
// FormHTool // FormHTool
// //
@ -590,5 +600,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem MCT格式ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem MCT格式ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
} }
} }

View File

@ -426,5 +426,26 @@ namespace MifareOneTool
} }
logAppend("已导出MCT文件" + filename + "。"); logAppend("已导出MCT文件" + filename + "。");
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
string filename;
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".dic";
ofd.Title = "请选择密钥字典文件保存位置及文件名";
ofd.OverwritePrompt = true;
ofd.Filter = "字典文件|*.dic";
if (ofd.ShowDialog() == DialogResult.OK)
{
filename = ofd.FileName;
}
else
{
return;
}
File.WriteAllLines(filename, this.currentS50.KeyListStr().ToArray());
logAppend("已导出密钥字典文件" + filename + "。");
}
} }
} }

View File

@ -123,9 +123,6 @@
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="s50BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="s50BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>155, 17</value> <value>155, 17</value>
</metadata> </metadata>

View File

@ -73,6 +73,12 @@
<Compile Include="Form1.Designer.cs"> <Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="FormDiff.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormDiff.Designer.cs">
<DependentUpon>FormDiff.cs</DependentUpon>
</Compile>
<Compile Include="FormHTool.cs"> <Compile Include="FormHTool.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -91,6 +97,9 @@
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="FormDiff.resx">
<DependentUpon>FormDiff.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormHTool.resx"> <EmbeddedResource Include="FormHTool.resx">
<DependentUpon>FormHTool.cs</DependentUpon> <DependentUpon>FormHTool.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>