修改CrackMe1.exe
修改CrackMe1.exe使得:只有输入你的学号才能出现成功提示。并且把“大家好…net”这段话全部换成自己自定义的英文。
(1)输入你的学号才能出现成功提示
第一步我们需要获得学号加密后的密文。参考CrackMe1.exe的加密过程,不难得到。
C#源代码:
/*
* Created by SharpDevelop.
* User:
* Date:
* Time: 15:43
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Text;
using System.Collections;
using System.IO;
using System.Security.Cryptography;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Serialization.Formatters.Binary;
namespace Project
{
/// <summary>
/// Description of Class1.
/// </summary>
public class Lab3_4
{
public static void Main(string[] args)
{
string result;
string data = "123456789";
byte[] bytes = Encoding.ASCII.GetBytes("wctf{wol");
byte[] bytes2 = Encoding.ASCII.GetBytes("dy_crack}");
DESCryptoServiceProvider descryptoServiceProvider = new DESCryptoServiceProvider();
int keySize = descryptoServiceProvider.KeySize;
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream, descryptoServiceProvider.CreateEncryptor(bytes, bytes2), CryptoStreamMode.Write);
StreamWriter streamWriter = new StreamWriter(cryptoStream);
streamWriter.Write(data);
streamWriter.Flush();
cryptoStream.FlushFinalBlock();
streamWriter.Flush();
result = Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
Console.WriteLine("加密后的结果为:"+result);
Console.ReadKey();
}
}
}
运行结果:
学号加密后的结果为:vkXl8nCEIRwc0IFLYf2*****
将判断条件处的密文修改为学号的密文:
编辑方法,修改代码为学号的密文:
输入学号:
(2)把“大家好…net”这段话全部换成自己自定义的英文。
用dnSpy打开CrackMe1.exe,将中文修改成英文。
运行结果: