吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 13351|回复: 29
收起左侧

[原创] 某个游戏木马的收信地址的解密算法分析

[复制链接]
zzage 发表于 2008-10-22 12:09
【文章标题】某个游戏木马的收信地址的解密算法分析
【文章作者】ZzAge[LCG]
【文章目标】某游戏木马
【相关工具】OllyDbg
【作者 Q Q】85400516
【作者邮箱】zzage@163.com
【作者主页】http://hi.baidu.com/zzage
【版权声明】此文发布于[吾爱破解]Ww.52PoJie.Cn,未经作者同意,转载请注明出处!


此游戏木马的收信地址被加密,经过三次加密,分析了下,所以就有了此文.至于游戏木马的大概工作流程,请看此http://www.52pojie.cn/read.php?tid-12413.html此贴 (AD)....哈哈!
一:
1.jpg

取收信的加密地址传送给EAX,看堆栈信息,收信的加密地址!我们右键-数据窗口重跟随数值!看到加密后收信的地址!

2.jpg

取收信的加密地址的值数传送给EBP,看堆栈信息,知道收信的加密地址值数为19!

3.jpg

二:
4.jpg
100026FF |. 76 10 jbe short 10002711 10002701 |> 8A1401 /mov dl, byte ptr [ecx+eax] ; 取加密的收信地址的第i个值,把他传送给DL! 10002704 |. 80F2 AA |xor dl, 0AA ; DL=DL XOR 0AA 把DL与0AA做异或运算 10002707 |. F6D2 |not dl ; DL=NOE DL 把DL做位取反运算 10002709 |. 881401 |mov byte ptr [ecx+eax], dl ; 把做运算后的DL值传送到收信的加密第i个值的位置上! 1000270C |. 41 |inc ecx ; i=i+1 1000270D |. 3BCD |cmp ecx, ebp ; 把i跟收信加密地址值数19比较,不大则跳转 1000270F |.^ 72 F0 \jb short 10002701 ; 不大则跳转,做循环运算!

111.JPG

经过第一次解密后的收信地址的值!

三:
6.jpg
1000271B |. 56 push esi ; 倒序运算 1000271C |. 8D7428 FF lea esi, dword ptr [eax+ebp-1] ; 取经过第一次解密的加密收信地址 倒序 地址传送给ESI 10002720 |> 8A1E /mov bl, byte ptr [esi] ; 取收信加密地址倒序第i个值 10002722 |. 8A1401 |mov dl, byte ptr [ecx+eax] ; 取收信加密地址正序第j个值 10002725 |. 881C01 |mov byte ptr [ecx+eax], bl ; 把倒序的第i值放在正序的第j值位置上 10002728 |. 41 |inc ecx ; j=j+1 10002729 |. 8816 |mov byte ptr [esi], dl ; 把正序的第j值放在正序的第i值位置上~这里也就是做交换位置算法 1000272B |. 4E |dec esi ; i=i-1 1000272C |. 3BCF |cmp ecx, edi ; 把i和EDI比较 1000272E |.^ 72 F0 \jb short 10002720 ; 不大则跳转,做循环运算!

222.JPG

经过第二次解密后的收信地址的值!

四:
5.jpg
1000273A | 8D9B 00000000 lea ebx, dword ptr [ebx] 10002740 |> 8A1C01 /mov bl, byte ptr [ecx+eax] ; 取倒序第j=(i-1)的值传送到BL 10002743 |. 8A5401 01 |mov dl, byte ptr [ecx+eax+1] ; 取倒序第i的值传送到DL 10002747 |. 2ADA |sub bl, dl ; BL=BL-DL 10002749 |. 49 |dec ecx ; j=j-1 1000274A |. 885C01 01 |mov byte ptr [ecx+eax+1], bl ; 把DL放在倒数j+1的位置上 1000274E |.^ 79 F0 \jns short 10002740 ; 做循环运算

333.JPG

经过第三次解密后的收信地址的值完全解密!
100026F0 /$ 8B4424 04 mov eax, dword ptr [esp+4] ; 取收信的加密地址传送给EAX,看堆栈信息,收信的加密地址!我们右键-数据窗口重跟随数值!看到加密后收信的地址! 100026F4 |. 53 push ebx 100026F5 |. 55 push ebp 100026F6 |. 8B6C24 10 mov ebp, dword ptr [esp+10] ; 取收信的加密地址的值数传送给EBP,看堆栈信息,知道收信的加密地址值数为19! 100026F0 /$ 8B4424 04 mov eax, dword ptr [esp+4] ; 取收信的加密地址传送给EAX 100026F4 |. 53 push ebx 100026F5 |. 55 push ebp 100026F6 |. 8B6C24 10 mov ebp, dword ptr [esp+10] ; 取收信的加密地址的值数传送给EBP 100026FA |. 33C9 xor ecx, ecx 100026FC |. 85ED test ebp, ebp 100026FE |. 57 push edi 100026FF |. 76 10 jbe short 10002711 10002701 |> 8A1401 /mov dl, byte ptr [ecx+eax] ; 取加密的收信地址的第i个值,把他传送给DL! 10002704 |. 80F2 AA |xor dl, 0AA ; DL=DL XOR 0AA 把DL与0AA做异或运算 10002707 |. F6D2 |not dl ; DL=NOE DL 把DL做位取反运算 10002709 |. 881401 |mov byte ptr [ecx+eax], dl ; 把做运算后的DL值传送到收信的加密第i个值的位置上! 1000270C |. 41 |inc ecx ; i=i+1 1000270D |. 3BCD |cmp ecx, ebp ; 把i跟收信加密地址值数19比较,不大则跳转 1000270F |.^ 72 F0 \jb short 10002701 ; 不大则跳转,做循环运算! 10002711 |> 8BFD mov edi, ebp 10002713 |. D1EF shr edi, 1 10002715 |. 33C9 xor ecx, ecx 10002717 |. 85FF test edi, edi 10002719 |. 76 16 jbe short 10002731 1000271B |. 56 push esi ; 倒序运算 1000271C |. 8D7428 FF lea esi, dword ptr [eax+ebp-1] ; 取经过第一次解密的加密收信地址 倒序 地址传送给ESI 10002720 |> 8A1E /mov bl, byte ptr [esi] ; 取收信加密地址倒序第i个值 10002722 |. 8A1401 |mov dl, byte ptr [ecx+eax] ; 取收信加密地址正序第j个值 10002725 |. 881C01 |mov byte ptr [ecx+eax], bl ; 把倒序的第i值放在正序的第j值位置上 10002728 |. 41 |inc ecx ; j=j+1 10002729 |. 8816 |mov byte ptr [esi], dl ; 把正序的第j值放在正序的第i值位置上~这里也就是做交换位置算法 1000272B |. 4E |dec esi ; i=i-1 1000272C |. 3BCF |cmp ecx, edi ; 把i和EDI比较 1000272E |.^ 72 F0 \jb short 10002720 ; 不大则跳转,做循环运算! 10002730 |. 5E pop esi 10002731 |> 8D4D FE lea ecx, dword ptr [ebp-2] 10002734 |. 85C9 test ecx, ecx 10002736 |. 7C 18 jl short 10002750 10002738 |. EB 06 jmp short 10002740 1000273A | 8D9B 00000000 lea ebx, dword ptr [ebx] 10002740 |> 8A1C01 /mov bl, byte ptr [ecx+eax] ; 取倒序第j=(i-1)的值传送到BL 10002743 |. 8A5401 01 |mov dl, byte ptr [ecx+eax+1] ; 取倒序第i的值传送到DL 10002747 |. 2ADA |sub bl, dl ; BL=BL-DL 10002749 |. 49 |dec ecx ; j=j-1 1000274A |. 885C01 01 |mov byte ptr [ecx+eax+1], bl ; 把DL放在倒数j+1的位置上 1000274E |.^ 79 F0 \jns short 10002740 ; 做循环运算 10002750 |> 5F pop edi 10002751 |. 5D pop ebp 10002752 |. 5B pop ebx 10002753 \. C3 retn

j.jpg

再贴上我用delphi写的收信地址的加密源代码!
代码垃圾...大牛可以飞过
 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Edit1: TEdit; Edit2: TEdit; Button1: TButton; Edit3: TEdit; Label1: TLabel; Label2: TLabel; Label3: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function Encrypt(s: string): string; var tmpstr:string; i:integer; begin tmpstr := ''; for i:=1 to length(s) do begin tmpstr:=tmpstr + IntToHex(not ord(s[i]) xor $0AA,2); end; result := tmpstr; end; function myStrtoHex(s: string): string; var tmpstr:string; i:integer; begin tmpstr := ''; for i:=1 to length(s) do begin tmpstr := tmpstr + inttoHex(ord(s[i]),2); end; result :=tmpstr; end; function myHextoStr(S: string): string; var hexS,tmpstr:string; i:integer; a:byte; begin hexS :=s; if length(hexS) mod 2=1 then begin hexS:=hexS+'0'; end; tmpstr:=''; for i:=1 to (length(hexS) div 2) do begin a:=strtoint('$'+hexS[2*i-1]+hexS[2*i]); tmpstr := tmpstr+chr(a); end; result :=tmpstr; end; function HextoBack(S: string): string; var hexS,tmpstr:string; i:integer; a:byte; begin hexS :=s; if length(hexS) mod 2=1 then begin hexS:=hexS+'0'; end; tmpstr:=''; for i:=1 to (length(hexS) div 2) do begin a:=strtoint('$'+hexS[2*i-1]+hexS[2*i]); tmpstr := chr(a)+tmpstr; end; result :=tmpstr; end; procedure TForm1.Button1Click(Sender: TObject); var tmpstr:string; i:integer; s1,s2,s3,s4:string; begin s1:=Edit1.Text; for i:=1 to length(s1) do begin tmpstr := tmpstr + inttoHex(ord(s1[i])+ord(s1[i-1]),2); end; s2:=tmpstr+inttoHex(ord(s1[length(s1)]),2); s3:=Copy(s2,3,Length(s2)); s4:=myStrtoHex(HextoBack(s3)); Edit2.Text:=Encrypt(myHextoStr(s4)); Edit3.Text:=myHextoStr(Edit2.Text); end; end. 
--------------------------------我是分割线-------------------------------
此文完成于 2008 - 10 - 22
--------------------------------我是分割线-------------------------------

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

zx278212442 发表于 2008-10-22 12:22
我晕
这个是发在这个区的么!
BS
强烈的
tianxj 发表于 2008-10-22 12:27
 楼主| zzage 发表于 2008-10-22 12:35
引用第2楼tianxj于2008-10-22 12:27发表的:
高手也,学学 [s:39][s:39]

汗....
向T大学习......
aisht 发表于 2008-10-22 12:41
[s:43] 看过了..嘎嘎
来摸摸zz的jj
ychyax 发表于 2008-10-22 13:08
真的可以吗?看看了 [s:39]
lyhzone 发表于 2008-10-22 18:01
看到晕啊~~~~~~~ [s:17]
史路比 发表于 2008-10-22 20:25
深奥!
看不过!!
学习一下!
cracker 发表于 2008-10-26 13:27
A毛.. 果然又来装人妖...
kl6636207 发表于 2008-10-27 22:18
看不懂哦 高手,能交下我们吗?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-24 05:47

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表