📄 form1.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
namespace Crack_ServU_6._._.__OTP_STORAG
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//24402334336B3B23
//306C2C3A3E6E6B6C
//736A24233930326D
//6C6B6E2B2D5F6C00
byte[] key = {0x24, 0x40, 0x23, 0x34, 0x33, 0x6B, 0x3B, 0x23,
0x30, 0x6C, 0x2C, 0x3A, 0x3E, 0x6E, 0x6B, 0x6C,
0x73, 0x6A, 0x24, 0x23, 0x39, 0x30, 0x32, 0x6D,
0x6C, 0x6B, 0x6E, 0x2B, 0x2D, 0x5F, 0x6C, 0x00};//32个
char[] trimChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private void button_crack_Click(object sender, EventArgs e)
{
string sCipher = textBox_Cipher.Text.Trim(' ').ToUpper();
//MessageBox.Show("0x" + sCipher.Substring(6 * 2, 2));
//return;
if (sCipher.Length % 2 != 0) {
MessageBox.Show("密文复制错误,长度不对!");
return;
}
if (sCipher.Trim(trimChars).Length != 0) {
MessageBox.Show("格式错误!");
return;
}
if (sCipher.Length > 201) {
MessageBox.Show("The evaluation version can only take password less than 8 character!");
return;
}
textBox_plaintext.Text = "";
for (int i = 0; i < sCipher.Length / 2; i++) {
//int r = Convert.ToInt32("0x" + value.Substring(1, 2),16);
//byte temp = Int32.Parse(sCipher);
//byte temp = (byte)Convert.ToInt16("0x" + sCipher.Substring(i * 2 + 1, 2), 16) ^ key[i];
Byte temp = (byte)(Byte.Parse(sCipher.Substring(i * 2, 2), NumberStyles.AllowHexSpecifier) ^ key[i % 32]);//
//string sT = sCipher.Substring(i * 2, 2);
//MessageBox.Show(sT);
//byte temp = Byte.Parse(sT, NumberStyles.AllowHexSpecifier);
textBox_plaintext.Text += Convert.ToChar(temp);
}
//textBox_plaintext.Text = "haha";
}
private void button1_Click(object sender, EventArgs e)
{
string sPlaintext = textBox_Cipher.Text;
if (sPlaintext.Length > 101) {
MessageBox.Show("The evaluation version can only take password less than 8 character!");
return;
}
textBox_plaintext.Text = "";
for (int i = 0; i < sPlaintext.Length; i++) {
Byte temp = (byte)((byte)sPlaintext[i] ^ key[i % 32]);
if (temp > 0x0F) {
textBox_plaintext.Text += Convert.ToString(temp, 16);
}
else {
textBox_plaintext.Text += "0" + Convert.ToString(temp, 16);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -