首页
社区
课程
招聘
[原创]Evonsoft Advanced Spyware Remover Professional v1.54注册算法分析
发表于: 2005-11-22 14:30 4083

[原创]Evonsoft Advanced Spyware Remover Professional v1.54注册算法分析

2005-11-22 14:30
4083
【破解作者】 隐者无疆[BCG]
【使用工具】 Peid,Dede,OD,WinHex
【破解平台】 Win XP Sp2
【软件名称】 Evonsoft Advanced Spyware Remover Professional v1.54
【下载地址】 http://www.evonsoft.com/
【软件简介】
             It is an advanced but easy-to-use software that can scan and remove spyware,adware,malware,
        pc hijacker programs while it immunize most of the known spyware,adware,malware and it tweaks the
        contents of key areas of the Registry and System.

【软件大小】 504kb
【加壳方式】 ASPack 2.12 -> Alexey Solodovnikov
【破解声明】 我是一只小菜鸟,偶得一点心得,愿与大家分享:)
--------------------------------------------------------------------------------
【破解内容】

1.Peid侦壳,显示"ASPack 2.12 -> Alexey Solodovnikov";用aspackdie脱之。
  脱壳后的程序运行时一闪就没了,看来程序有自校验,暂不解除自校验。Peid侦测脱壳后的文件,知程序使用
  Delphi编写。
2.用Dede反编译脱壳后的程序。
  TForm3的单元名为"Registration",可见这个窗体就是我们输入注册码的窗口。查看它对应的说有事件。
  两个EditChange方法的作用为:若两个文本框均非空,则置button1(其标题为"Active Now")为Enabled
  三个ButtonClick方法分别对应三个button。其中button1click是我们所关心的,它的作用是:置Timer1为Enabled
  Timer1Timer的作用是:定时检测注册码是否合法,这段代码是分析的重点。
3.用OD加载未脱壳的程序。F9运行。 根据Dede的提示,在4e8cd0处下断点。
  输入下列内容进行注册:
  RegName:warshon
  RegCode:1234567890
  程序被断下。
贴出代码如下
004E8CD0   |.  push dword ptr fs:[eax]
004E8CD3   |.  mov dword ptr fs:[eax],esp
004E8CD6   |.  xor edx,edx
004E8CD8   |.  mov eax,dword ptr ds:[esi+324]
004E8CDE   |.  call <AsrPro.TTimer.SetEnabled>
004E8CE3   |.  lea edx,dword ptr ss:[ebp-C]
004E8CE6   |.  mov eax,dword ptr ds:[esi+304]
004E8CEC   |.  call <AsrPro.GetText>                                       ;  Get RegCode
004E8CF1   |.  mov eax,dword ptr ss:[ebp-C]
004E8CF4   |.  lea ecx,dword ptr ss:[ebp-8]
004E8CF7   |.  mov edx,AsrPro.004E8E94                                     ;  ASCII "i1984"
004E8CFC   |.  call AsrPro.004EA6C8
004E8D01   |.  mov eax,dword ptr ss:[ebp-8]
004E8D04   |.  mov edx,AsrPro.004E8EA4                                     ;  ASCII "Tales_xqs"
004E8D09   |.  call <AsrPro.LStrCmp>
004E8D0E   |. >jnz <AsrPro.wrong>                                          ;  Go to Hell

4e8d0e跳转到出错信息。
看到紧接着上面调用了LStrCmp,貌似一个经典的关键比较。在4e8d09处设断,F9运行,断下。
察看寄存器窗口:
EAX 018B0C60 //内存地址,内容未知。
EDX 004E8EA4 ASCII "Tales_xqs"

用WinHex察看AsrPro.exe的内存。
看到Eax并不是指向前面输入的Name或Code,而是"K3?"。看来是程序对输入的Name或Code进行处理,
然后与"Tales_xqs"进行比较,若相同则注册码合法。

4e8cec处获得的regcode被作为参数传给call 4e8cfc。跟进此call,贴出代码如下:
============================call AsrPro.004EA6C8================================
/*4EA706*/  push dword ptr fs:[eax]
/*4EA709*/  mov dword ptr fs:[eax],esp
/*4EA70C*/  xor eax,eax
/*4EA70E*/  push ebp
/*4EA70F*/  push AsrPro.004EA80B
/*4EA714*/  push dword ptr fs:[eax]
/*4EA717*/  mov dword ptr fs:[eax],esp
/*4EA71A*/  mov eax,dword ptr ss:[ebp-8]  //ASCII 'i1984'
/*4EA71D*/  call <AsrPro.LStrLen>
/*4EA722*/  mov dword ptr ss:[ebp-10],eax  //!!ss:[ebp-10]
/*4EA725*/  cmp dword ptr ss:[ebp-10],0
/*4EA729*/  jnz short AsrPro.004EA738
/*4EA72B*/  lea eax,dword ptr ss:[ebp-8]
/*4EA72E*/  mov edx,AsrPro.004EA868
/*4EA733*/  call <AsrPro.LStrLAsg>
/*4EA738*/  xor esi,esi
/*4EA73A*/  lea eax,dword ptr ss:[ebp-24]
/*4EA73D*/  push eax
/*4EA73E*/  mov ecx,2
/*4EA743*/  mov edx,1
/*4EA748*/  mov eax,dword ptr ss:[ebp-4]
/*4EA74B*/  call <AsrPro.LStrCopy>
/*4EA750*/  mov ecx,dword ptr ss:[ebp-24]
/*4EA753*/  lea eax,dword ptr ss:[ebp-20]
/*4EA756*/  mov edx,<AsrPro.Ascii '$'>
/*4EA75B*/  call <AsrPro.LStrCat3>
/*4EA760*/  mov eax,dword ptr ss:[ebp-20]
/*4EA763*/  call <AsrPro.StrToInt>
/*4EA768*/  mov edi,eax  //!! edi
/*4EA76A*/  mov dword ptr ss:[ebp-18],3
/*4EA771*/  lea eax,dword ptr ss:[ebp-2C]
/*4EA774*/  push eax
/*4EA775*/  mov ecx,2
/*4EA77A*/  mov edx,dword ptr ss:[ebp-18]
/*4EA77D*/  mov eax,dword ptr ss:[ebp-4]
/*4EA780*/  call <AsrPro.LStrCopy>
/*4EA785*/  mov ecx,dword ptr ss:[ebp-2C]
/*4EA788*/  lea eax,dword ptr ss:[ebp-28]
/*4EA78B*/  mov edx,<AsrPro.Ascii '$'>
/*4EA790*/  call <AsrPro.LStrCat3>
/*4EA795*/  mov eax,dword ptr ss:[ebp-28]
/*4EA798*/  call <AsrPro.StrToInt>
/*4EA79D*/  mov dword ptr ss:[ebp-1C],eax
/*4EA7A0*/  cmp esi,dword ptr ss:[ebp-10]
/*4EA7A3*/  jge short AsrPro.004EA7A8
/*4EA7A5*/  inc esi
/*4EA7A6*/  jmp short AsrPro.004EA7AD
/*4EA7A8*/  mov esi,1
/*4EA7AD*/  mov eax,dword ptr ss:[ebp-8]  //ASCII 'i1984'
/*4EA7B0*/  xor ebx,ebx
/*4EA7B2*/  mov bl,byte ptr ds:[eax+esi-1]  //!! bl
/*4EA7B6*/  xor ebx,dword ptr ss:[ebp-1C]
/*4EA7B9*/  cmp edi,ebx
/*4EA7BB*/  jl short AsrPro.004EA7C7
/*4EA7BD*/  add ebx,0FF
/*4EA7C3*/  sub ebx,edi
/*4EA7C5*/  jmp short AsrPro.004EA7C9
/*4EA7C7*/  sub ebx,edi
/*4EA7C9*/  lea eax,dword ptr ss:[ebp-30]
/*4EA7CC*/  mov edx,ebx
/*4EA7CE*/  call <AsrPro.LStrFromChar>
/*4EA7D3*/  mov edx,dword ptr ss:[ebp-30]
/*4EA7D6*/  lea eax,dword ptr ss:[ebp-14]
/*4EA7D9*/  call <AsrPro.LStrCat>
/*4EA7DE*/  mov edi,dword ptr ss:[ebp-1C]  //!!保存前两位的int值
/*4EA7E1*/  add dword ptr ss:[ebp-18],2    //!!注册码index+2
/*4EA7E5*/  mov eax,dword ptr ss:[ebp-4]
/*4EA7E8*/  call <AsrPro.LStrLen>
/*4EA7ED*/  cmp eax,dword ptr ss:[ebp-18]  //判断注册码是否处理完
/*4EA7F0*/  jg AsrPro.004EA771
/*4EA7F6*/  mov eax,dword ptr ss:[ebp-C]
/*4EA7F9*/  mov edx,dword ptr ss:[ebp-14]
/*4EA7FC*/  call <AsrPro.LStrAsg>
/*4EA801*/  xor eax,eax
/*4EA803*/  pop edx
/*4EA804*/  pop ecx
/*4EA805*/  pop ecx
/*4EA806*/  mov dword ptr fs:[eax],edx
/*4EA809*/  jmp short AsrPro.004EA81F
/*4EA80B*/  jmp AsrPro.00403864
/*4EA810*/  mov eax,AsrPro.004EA884
/*4EA815*/  call AsrPro.00433154
/*4EA81A*/  call AsrPro.00403BCC
/*4EA81F*/  xor eax,eax  //****** END

4.写出伪码注册认证算法如下:
注册码只能包含如下字符"1234567890abcdef"
注册码的长度必须为为20个字符
const s1[]="i1984";
const s2[]="Tales_xqs";
char code[],buffer[]=NULL;
code=GetCode();
int pre,curr,index_code = 0,index_s1 = 0,index_buf = 0,ch;

while(index_code < 20)
{
pre = StrToInt( StrCopy(code,index_code,2) ); //从code的第index_code个字符开始,取两个字符
index_code = index_code + 2:
curr = StrToInt( StrCopy(code,index_code,2) );
index_code = index_code + 2:
if( index_s1++ > 4 ) index_s1 = 0;
ch = curr^s1[index_s1];
buffer[index_buf++] = ch>pre ? (ch - pre):(ch + 0xff - pre);
pre = curr;
}
if( StrCmp(buffer,s2) == 0 )
注册码合法;
else
注册码非法;

5.关于注册码生成算法
由于上述注册码验证算法只使用了异或运算和算术运算,很容易写出逆算法,这里就不写注册机了。

[课程]Linux pwn 探索篇!

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 817
活跃值: (1927)
能力值: ( LV12,RANK:2670 )
在线值:
发帖
回帖
粉丝
2
支持
2005-11-22 21:52
0
雪    币: 61
活跃值: (160)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
3
支持
2005-11-22 22:16
0
游客
登录 | 注册 方可回帖
返回
//