优化交互逻辑

This commit is contained in:
XAS-712 2018-12-25 19:56:26 +08:00
parent 94be6222b2
commit 31489babe4
6 changed files with 377 additions and 34 deletions

View File

@ -49,9 +49,13 @@
this.buttonConSave = new System.Windows.Forms.Button();
this.buttonConClr = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.buttonGuide = new System.Windows.Forms.Button();
this.buttonHexTool = new System.Windows.Forms.Button();
this.buttonMfcuk = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@ -117,7 +121,7 @@
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(623, 293);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "Hello,cardman!\n";
this.richTextBox1.Text = "Hello,cardman!\n建议点击\"检测\"以加快后续运行速度\n";
//
// buttonMfRead
//
@ -153,7 +157,7 @@
this.buttonBmfWrite.Name = "buttonBmfWrite";
this.buttonBmfWrite.Size = new System.Drawing.Size(75, 23);
this.buttonBmfWrite.TabIndex = 10;
this.buttonBmfWrite.Text = "后门写";
this.buttonBmfWrite.Text = "UID写";
this.buttonBmfWrite.UseVisualStyleBackColor = true;
this.buttonBmfWrite.Click += new System.EventHandler(this.buttonBmfWrite_Click);
//
@ -163,7 +167,7 @@
this.buttonBmfRead.Name = "buttonBmfRead";
this.buttonBmfRead.Size = new System.Drawing.Size(75, 23);
this.buttonBmfRead.TabIndex = 9;
this.buttonBmfRead.Text = "后门读";
this.buttonBmfRead.Text = "UID读";
this.buttonBmfRead.UseVisualStyleBackColor = true;
this.buttonBmfRead.Click += new System.EventHandler(this.buttonBmfRead_Click);
//
@ -271,6 +275,9 @@
//
// groupBox4
//
this.groupBox4.Controls.Add(this.buttonMfcuk);
this.groupBox4.Controls.Add(this.buttonHexTool);
this.groupBox4.Controls.Add(this.buttonGuide);
this.groupBox4.Location = new System.Drawing.Point(641, 101);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(169, 293);
@ -278,6 +285,36 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "工具";
//
// buttonGuide
//
this.buttonGuide.Enabled = false;
this.buttonGuide.Location = new System.Drawing.Point(6, 24);
this.buttonGuide.Name = "buttonGuide";
this.buttonGuide.Size = new System.Drawing.Size(156, 45);
this.buttonGuide.TabIndex = 0;
this.buttonGuide.Text = "向导模式";
this.buttonGuide.UseVisualStyleBackColor = true;
this.buttonGuide.Click += new System.EventHandler(this.buttonGuide_Click);
//
// buttonHexTool
//
this.buttonHexTool.Location = new System.Drawing.Point(6, 75);
this.buttonHexTool.Name = "buttonHexTool";
this.buttonHexTool.Size = new System.Drawing.Size(156, 45);
this.buttonHexTool.TabIndex = 1;
this.buttonHexTool.Text = "Hex工具";
this.buttonHexTool.UseVisualStyleBackColor = true;
//
// buttonMfcuk
//
this.buttonMfcuk.Font = new System.Drawing.Font("宋体", 8.5F);
this.buttonMfcuk.Location = new System.Drawing.Point(6, 126);
this.buttonMfcuk.Name = "buttonMfcuk";
this.buttonMfcuk.Size = new System.Drawing.Size(156, 45);
this.buttonMfcuk.TabIndex = 3;
this.buttonMfcuk.Text = "全加密密钥恢复\r\nMFCUK";
this.buttonMfcuk.UseVisualStyleBackColor = true;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@ -297,6 +334,7 @@
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -324,6 +362,9 @@
private System.Windows.Forms.Button buttonKill;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.Button buttonGuide;
private System.Windows.Forms.Button buttonHexTool;
private System.Windows.Forms.Button buttonMfcuk;
}
}

View File

@ -109,21 +109,7 @@ namespace MifareOneTool
private void buttonMfRead_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
string rmfd = "";
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
ofd.Title = "请选择MFD文件保存位置及文件名";
ofd.OverwritePrompt = true;
ofd.Filter = "MFD文件|*.mfd";
if (ofd.ShowDialog() == DialogResult.OK)
{
rmfd = ofd.FileName;
}
else
{
return;
}
string rmfd = "MfRead.tmp";
string kt = "a";
string nn = "";
switch (MessageBox.Show("使用KeyA或KeyB还是不使用用于全新白卡取消", "KeyA/B/N", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information))
@ -141,6 +127,23 @@ namespace MifareOneTool
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(new string[] { rmfd, kt,nn });
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
ofd.Title = "请选择MFD文件保存位置及文件名";
ofd.OverwritePrompt = true;
ofd.Filter = "MFD文件|*.mfd";
if (ofd.ShowDialog() == DialogResult.OK)
{
File.Move(rmfd, ofd.FileName);
logAppend("##已保存-" + ofd.FileName + "##");
}
else
{
File.Delete(rmfd);
logAppend("##未保存##");
}
}
void mf_read(object sender, DoWorkEventArgs e)
@ -264,7 +267,13 @@ namespace MifareOneTool
private void buttonMfoc_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
string rmfd = "";
string rmfd = "Mfoc.tmp";
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(mfoc);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(rmfd);
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
@ -273,17 +282,14 @@ namespace MifareOneTool
ofd.Title = "请选择破解MFD的保存位置及文件名";
if (ofd.ShowDialog() == DialogResult.OK)
{
rmfd = ofd.FileName;
File.Move(rmfd,ofd.FileName);
logAppend("##已保存-" + ofd.FileName + "##");
}
else
{
return;
File.Delete(rmfd);
logAppend("##未保存##");
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(mfoc);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(rmfd);
}
void mfoc(object sender, DoWorkEventArgs e)
@ -395,7 +401,13 @@ namespace MifareOneTool
private void buttonBmfRead_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } Form1.ActiveForm.Text = "MifareOne Tool - 运行中";
string rmfd = "";
string rmfd = "BmfRead.tmp";
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(bmf_read);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(new string[] { rmfd });
SaveFileDialog ofd = new SaveFileDialog();
ofd.AddExtension = true;
ofd.DefaultExt = ".mfd";
@ -404,17 +416,14 @@ namespace MifareOneTool
ofd.Title = "请选择MFD文件的保存位置及文件名";
if (ofd.ShowDialog() == DialogResult.OK)
{
rmfd = ofd.FileName;
File.Move(rmfd, ofd.FileName);
logAppend("##已保存-" + ofd.FileName + "##");
}
else
{
return;
File.Delete(rmfd);
logAppend("##未保存##");
}
BackgroundWorker bgw = new BackgroundWorker();
bgw.DoWork += new DoWorkEventHandler(bmf_read);
bgw.WorkerReportsProgress = true;
bgw.ProgressChanged += new ProgressChangedEventHandler(default_rpt);
bgw.RunWorkerAsync(new string[] { rmfd });
}
void bmf_read(object sender, DoWorkEventArgs e)
@ -561,5 +570,15 @@ namespace MifareOneTool
{
Process.Start("https://github.com/xcicode/MifareOneTool/releases/latest");
}
private void buttonGuide_Click(object sender, EventArgs e)
{
if (lprocess) { MessageBox.Show("有任务运行中,不可执行。", "设备忙", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
Text = "MifareOne Tool - 向导模式运行中";
FormGuide fg = new FormGuide();
fg.ShowDialog();
lprocess = false;
Text = "MifareOne Tool - 向导模式运行完毕";
}
}
}

130
MifareOneTool/FormGuide.Designer.cs generated Normal file
View File

@ -0,0 +1,130 @@
namespace MifareOneTool
{
partial class FormGuide
{
/// <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.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.tabControl1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
this.tabControl1.Controls.Add(this.tabPage5);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(482, 353);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Location = new System.Drawing.Point(4, 28);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(474, 321);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "开始";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 28);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(474, 321);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "操作";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 28);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(474, 321);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "需要提供的信息";
this.tabPage3.UseVisualStyleBackColor = true;
//
// tabPage4
//
this.tabPage4.Location = new System.Drawing.Point(4, 28);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(474, 321);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "认证(密码)";
this.tabPage4.UseVisualStyleBackColor = true;
//
// tabPage5
//
this.tabPage5.Location = new System.Drawing.Point(4, 28);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(474, 321);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "开始工作";
this.tabPage5.UseVisualStyleBackColor = true;
//
// FormGuide
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(482, 353);
this.ControlBox = false;
this.Controls.Add(this.tabControl1);
this.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "FormGuide";
this.Text = "MifareOne 向导模式";
this.Load += new System.EventHandler(this.FormGuide_Load);
this.tabControl1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabPage tabPage5;
}
}

View File

@ -0,0 +1,24 @@
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 FormGuide : Form
{
public FormGuide()
{
InitializeComponent();
}
private void FormGuide_Load(object sender, EventArgs e)
{
}
}
}

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

@ -72,12 +72,21 @@
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="FormGuide.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormGuide.Designer.cs">
<DependentUpon>FormGuide.cs</DependentUpon>
</Compile>
<Compile Include="GitHubUpdate.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormGuide.resx">
<DependentUpon>FormGuide.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>