【unity逆向】【buu】[BJDCTF2020]BJD hamburger competition
好久没做unity逆向有点忘了
先说工具,使用ILSpy,这个是github开源项目,
下载与食用方法:
https://blog.csdn.net/lilongsy/article/details/130179189?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522172135563016800227423365%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=172135563016800227423365&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_click~default-1-130179189-null-null.142
https://blog.csdn.net/weixin_44785150/article/details/130591983?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522172135563016800227423365%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=172135563016800227423365&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_click~default-2-130591983-null-null.142
[BJDCTF2020]BJD hamburger competition
然后将**~~~~\BJD hamburger competition_Data\Managed\Assembly-CSharp.dll**用ILSpy打开
(什么你说不一样,展不开?➕是干什么用的兄弟)
发现有个SHA1字符串,如果str经过SHA1加密后是这个字符串就对str进行Md5加密,
找个在线网站加密去了,交后发现是错的,跟进Md5看一下
由于本人没什么C#基础,接下来对关键部分进行解释
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| public class HashUtil { public static string Md5(string str) { byte[] bytes = Encoding.UTF8.GetBytes(str); byte[] hashBytes = MD5.Create().ComputeHash(bytes); StringBuilder stringBuilder = new StringBuilder(); foreach (byte b in hashBytes) { stringBuilder.Append(b.ToString("X2")); stringBuilder.Append(b.ToString("X2")); } string fullHashString = stringBuilder.ToString(); return fullHashString.Substring(0, 20); } }
|
这串代码是输出MD5的前20个字符,并且全用大写字母表示,
而正常的MD5有32个字符,所以我们只需要截取前20个字符然后转换成大写就可以得出FLAG