- UID
- 2
注册时间2004-12-1
阅读权限255
最后登录1970-1-1
总坛主
TA的每日心情 | 开心 2024-12-1 11:04 |
---|
签到天数: 12 天 [LV.3]偶尔看看II
|
【破文标题】与P-code 亲密接触2
【破文作者】飘云[PYG]
【作者邮箱】[email protected]
【作者主页】www.chinapyg.com
【破解工具】Peid0.94,WKTVBDE,VC++
【破解平台】Win9x/NT/2000/XP
【软件名称】Pcode CrackMe1
【软件大小】16kb
【原版下载】论坛下载
【保护方式】用户名+注册码
【特别说明】这是为了和大家讲解Pcode 而特别写的CrackMe 从易到难......
------------------------------------------------------------------------
【分析过程】
WKTVBDE 打开程序 并下好断点(具体怎么操作,请看<<与P-code 亲密接触1>>)
输入注册信息:
******************
name:piaoyun
serial:123456789
******************
F8跟踪吧>>>>>:
004026E4: 28 LitVarI2 0012F550h 0h , 0
004026E9: FC Lead1/FStVar
004026ED: 04 FLdRfVar 0012F548h
004026F0: 21 FLdPrThis 00145DC8h
004026F1: 0F VCallAd Form1.Text1 //定位到Form1.Text1 即用户名输入框
004026F4: 19 FStAdFunc
004026F7: 08 FLdPr
004026FA: 0D VCallHresult get__ipropTEXTEDIT //取用户名
004026FF: 3E FLdZeroAd
00402702: 46 CVarStr
00402705: FC Lead1/FStVar
00402709: 1A FFree1Ad
0040270C: 4B OnErrorGoto 00402888h
0040270F: 04 FLdRfVar 0012F548h
00402712: 21 FLdPrThis 00145DC8h
00402713: 0F VCallAd Form1.Text2 //定位到Form1.Text2 即注册码输入框
00402716: 19 FStAdFunc
00402719: 08 FLdPr
0040271C: 0D VCallHresult get__ipropTEXTEDIT //取假码
00402721: 3E FLdZeroAd
00402724: 31 FStStr
00402727: 1A FFree1Ad
0040272A: 04 FLdRfVar 0012F578h
0040272D: EB FnLenVar
00402731: 28 LitVarI2 0h , 0 // 参数 0
00402736: 5D HardType
00402737: 2F EqVar
0040273B: 6C ILdRf 0015695Ch //假码地址
0040273E: 4A FnLenStr 00156958h , 9 chars //取假码长度(我这里是9个字符)
0040273F: F5 LitI4: -> 0h 0 // 参数 0
00402744: C7 EqI4 0h,9h? //长度为0?
00402745: FD Lead2/CVarBoolI2
00402749: 1F OrVar //or 或运算
0040274D: FF Lead4/CBoolVarNull //不为空
0040274F: 35 FFree1Var
00402752: 1C BranchF 00402759 ? //上面条件满足了,这里就会跳转~~
00402755: 13 ExitProcHresult
00402756: 1E Branch 004027F1 ?
00402759: 28 LitVarI2 0012F518h 1h , 1 //跳转到这里,就是算法了~~ 参数1(循环起始条件)
0040275E: 04 FLdRfVar 0012F4F8h
00402761: 04 FLdRfVar 0012F578h
00402764: EB FnLenVar //用户名长度,做为循环终止条件
00402768: FE Lead3/ForVar
0040276E: 04 FLdRfVar 0012F564h
00402771: 28 LitVarI2 1h , 1 //参数1(表示取一个字符的意思)
00402776: 04 FLdRfVar 0012F4F8h
00402781: 0A ImpAdCallFPR4 rtcMidCharVar on address 660E64F3h //很明显了mid(name,i,1)
00402786: 04 FLdRfVar 0012F528h
00402789: FD Lead2/CStrVarVal //类型转换
0040278D: 0B ImpAdCallI2 rtcAnsiValueBstr on address 660E657Bh //char(mid(name,i,1))
00402792: 44 CVarI2
00402795: 94 AddVar //嘿嘿,这里来了一个累加
00402799: FC Lead1/FStVar
0040279D: 2F FFree1Str
004027A0: 36 FFreeVar -> 2 //咦!怪了,这里又重复上面的东东?
004027A7: 28 LitVarI2 0012F538h 1h , 1 //参数1(表示取一个字符的意思)
004027AC: 04 FLdRfVar 0012F4F8h
004027AF: FC Lead1/CI4Var
004027B1: 04 FLdRfVar 0012F578h
004027B4: 04 FLdRfVar 0012F528h
004027B7: 0A ImpAdCallFPR4 rtcMidCharVar on address 660E64F3h
004027BC: 04 FLdRfVar 0012F528h
004027BF: FD Lead2/CStrVarVal
004027C3: 0B ImpAdCallI2 rtcAnsiValueBstr on address 660E657Bh
004027C8: E7 CI4UI1
004027C9: 71 FStR4
004027CC: 2F FFree1Str
004027CF: 36 FFreeVar -> 2
004027D6: 04 FLdRfVar 0012F4F8h //这里可以看出:第二次取出的东西,始终没用用到,到底有什么用呢?
难道是迷糊性代码? 带着种种疑问向下看:
004027D9: FE Lead3/NextStepVar //next 直到循环终止(条件为:用户名长度)
004027DF: 04 FLdRfVar 0012F564h
004027E2: 6C ILdRf 00000070h
004027E5: FD Lead2/CVarI4
004027E9: 17 XorVar //哈哈,这里就可以解开疑团了,用户名ascii值累加和 Xor(异或) 最后一位用
户名ascii值
004027ED: FC Lead1/FStVar
004027F1: 6C ILdRf 0015695Ch //假码地址
004027F4: FC Lead1/CR8Str
004027F6: F5 LitI4: -> 12D687h 1234567 //参数 1234567 (固定字符串哦~~)
004027FB: EC CR8I4
004027FC: AF SubR4 //(sub,减运算)你输入的假码-1234567
004027FD: FC Lead1/CStrR8
004027FF: 23 FStStrNoPop
00402802: 0A ImpAdCallFPR4 rtcR8ValFromBstr on address 660D2DD4h //转换为整形
00402807: FD Lead2/CVarR8
0040280B: 5D HardType
0040280C: 04 FLdRfVar 0012F564h
0040280F: 33 EqVarBool //判断是否和前面计算的值相等
即: x-1234567=根据用户名计算的值(sum) ??
对x求逆就是:x=sum+1234567
00402811: 2F FFree1Str
00402814: 1C BranchF 0040284B (Jump ? //不相等就挂~~
00402817: 27 LitVar_Missing 0012F4A8h //否则,就看到光明哦~~~
0040281A: 27 LitVar_Missing 0012F508h
0040281D: 3A LitVarStr '恭喜'
00402822: 4E FStVarCopyObj 0012F528h
00402825: 04 FLdRfVar 0012F528h
00402828: F5 LitI4: -> 40h 64
0040282D: 3A LitVarStr '不错!你成功通过了!' //嘿嘿,到这里就通过了~~~
------------------------------------------------------------------------
【算法总结】
用户名逐位ascii值相加 然后和用户名最后一位ascii值 做异或运算~
上面的值加上1234567就是最后的注册码
- #include "iOStream.h"
- #include "string.h"
- #include "stdio.h"
- void main()
- {
- char name[50];
- int sum=0,s1=0;
- cout<<"\t\t***************************************\n";
- cout<<"\t\t* KeyGen for Pcode CrackMe1 *\n";
- cout<<"\t\t* By PiaoYun[PYG] *\n";
- cout<<"\t\t* https://www.chinapyg.com *\n";
- cout<<"\t\t* Email:[email protected] *\n";
- cout<<"\t\t***************************************\n";
- cout<<"Please Input Your Name:\n";
- cin>>name;
- if(strlen(name)>0)
- {
- for(int i=0;i<=(int)strlen(name);i++)
- {
- sum+=name[i];
- s1=name[i-1];
- }
- sum^=s1;
- sum+=1234567;
- cout<<"Your Serial:\n"<<sum<<endl;
- getchar();
- }
- else
- cout<<"Wrong!\n";
- }
复制代码
------------------------------------------------------------------------
【版权声明】本文纯属技术交流,转载请注明作者信息并保持文章的完整,谢谢! |
|