|
[原创]新人报道,一个自制CrackMe
// CrackMe004_cpp.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <map> #include <Windows.h> #include <tchar.h> using namespace std; map<int,string> has = map<int,string>(); inline int calc() //inline也可以让编译器制造混乱…… { int a; int inb; a = 3; scanf("%d", &inb); if (has[inb] != "") throw inb; //用了map;由于inline的存在,你们就看不懂判重的方法了……map内部是平衡树 //我想大多数这里玩CM的人都是看不懂的——特别是反编译出来的鬼代码 has[inb] = "Failure"; //混淆视听的常量 register int r = 1; register int base = a; register int b = inb; while (b != 0){ if (b % 2) { r *= base; r %= 17; } base *= base; base %= 17; a++; b /= 2; inb--; //a++和inb--是没有用的,因为已经用base和b中间存放了。只是混淆一下视听。 } //计算快速幂,计算3^inb模17的余数 return r; } int a[2] = {int('S')*2, int('a')*2}; int b[2] = {int('u')*4, int('B')*4}; int c[2] = {int('q')*3, int('c')*3}; int d[2] = {int('d')*7, int('c')*7}; int e[2] = {int('e')*32, int('M')*32}; int f[2] = {int('s')*64, int('f')*64}; int g[2] = {int('g')*128, int('s')*128}; int h[17] = {9,2,3,1,5,6,4,8,7,0}; //这里应该写h[10],写了17,所以有四位就达不到效果了(数组后面默认赋值0了) //设计的应该结果是0011001才能成功。现在所有0的位上随便输应该成功几率不小…… char buffer[10] = ""; void tryFunc() { buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(a[h[(int)buffer[9]]]/2)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(b[h[(int)buffer[9]]]/4)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(c[h[(int)buffer[9]]]/3)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(d[h[(int)buffer[9]]]/7)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(e[h[(int)buffer[9]]]/32)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(f[h[(int)buffer[9]]]/64)); buffer[9] = (char)calc(); sprintf(buffer, "%s%c", buffer, (char)(g[h[(int)buffer[9]]]/128)); string str = buffer; if (str == "Success") cout<<str; else throw buffer[9]; } int _tmain(int argc, _TCHAR* argv[]) { __try { tryFunc(); //用这样的方式调用,编译器编译__try__except的时候会制造混乱 } __except (EXCEPTION_EXECUTE_HANDLER) { cout<<"Failure"; } cin.get();cin.get(); //保留输出 return 0; } |
|
|
|
[原创]新人报道,一个自制CrackMe
我要公布算法吗? |
|
[原创]新人报道,一个自制CrackMe
Lnairan 我数学和算法很菜,让大神见笑了[em_40],其他位都好说用正确的ASCII码乘以相应的数得到结果,在到相应的内存中找对应的索引值,用程序跑一下得到一个结果,第3位的计算我是一点一点试的[em_16]我有一个常数写错了,所以7位只有3位是有效的。。 |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值