找回密码
 FreeOZ用户注册
查看: 1921|回复: 2
打印 上一主题 下一主题

[论坛技术] 一次反向工程的尝试

[复制链接]
跳转到指定楼层
1#
发表于 22-12-2008 16:25:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册

x
Delish是一个Delicious的插件,可以生成页面快照。又是一启动就要求购买的模式,还有12天的试用期。良好的软件设计,优秀的界面,典型的注册模式-经典的反向工程目标:


                               
登录/注册后可看大图


首先:otx Delish.app > Delish.otx
查看这个文件:mate Delish.otx。很快找到了这样的东西:-(BOOL)[LicenseController checkLicense]

很不错,这样就可以开始gdb了:
liwn:MacOS liweinan$ gdb Delish
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries ............... done
(gdb) b [LicenseController checkLicense]
Breakpoint 1 at 0xc6cd
(gdb) run
Starting program: /Users/liweinan/Desktop/Delish.app/Contents/MacOS/Delish
Reading symbols for shared libraries +++++++++++++........................................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done

Breakpoint 1, 0x0000c6cd in -[LicenseController checkLicense] ()

接下来结合Delish.otx中的内容看一下:
+0 0000c6c9  55   pushl   %ebp
+1 0000c6ca  89e5   movl   %esp,%ebp
+3 0000c6cc  53   pushl   %ebx
+4 0000c6cd  83ec24   subl   $0x24,%esp
+7 0000c6d0  a134360100   movl   0x00013634,%eax     licenseIsValid
   +12 0000c6d5  89442404   movl   %eax,0x04(%esp)
   +16 0000c6d9  8b4508   movl   0x08(%ebp),%eax
   +19 0000c6dc  890424   movl   %eax,(%esp)
   +22 0000c6df  e8c5990000   calll   0x000160a9     -[(%esp,1) licenseIsValid]
   +27 0000c6e4  84c0   testb   %al,%al
   +29 0000c6e6  0f8580010000   jnel   0x0000c86c
......

于是:
(gdb) b *0x0000c6e4
Breakpoint 3 at 0xc6e4
(gdb) c
Continuing.

Breakpoint 3, 0x0000c6e4 in -[LicenseController checkLicense] ()
(gdb) stepi
0x0000c6e6 in -[LicenseController checkLicense] ()
(gdb)
0x0000c6ec in -[LicenseController checkLicense] ()
(gdb) jump *0x0000c86c
Continuing at 0xc86c.
Reading symbols for shared libraries . done
2008-12-07 10:27:24.917 Delish[26015:813] Succeeded! Received 178 bytes of data
Reading symbols for shared libraries . done
2008-12-07 10:27:24.980 Delish[26015:813] delicious last update = str=2008-12-06T10:32:20Z (2008-12-06T10:32:20ZGMT)  lastRefresh:2008-12-06 19:26:24 +0800, 1
2008-12-07 10:27:24.980 Delish[26015:813] Refreshing from cache - /Users/liweinan/Library/Application Support/Delish/posts.xml
Reading symbols for shared libraries . done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries ... done

注册框消失:

                               
登录/注册后可看大图


游戏到这里就可以结束了,再写下去就非法了。

要说的是:MacOS的反盗版技术和M$平台相比,落后好远啊。

评分

参与人数 1威望 +30 收起 理由
coredump + 30 谢谢分享!

查看全部评分

回复  

使用道具 举报

2#
发表于 22-12-2008 16:37:02 | 只看该作者
原帖由 lwnxx 于 22-12-2008 15:25 发表
要说的是:MacOS的反盗版技术和M$平台相比,落后好远啊。

不赞同这句话,之所以可以用gdb跳过注册步骤一是因为ObjC是默认包含所有元数据和符号,二是因为人家作者压根没有真的想把注册做绝。这只能解释为Mac平台正版率高,不用费尽心机的防盗版,否则啥加壳,代码混淆之类的都是平台无关的技术,不分啥MS还是Mac的。
回复  

使用道具 举报

3#
 楼主| 发表于 22-12-2008 16:46:40 | 只看该作者

回复 #2 coredump 的帖子

哈哈,是啊。只不过M$上的盗版太凶了,这些小软件的作者,一般都不太在意反反向工程吧。反正俺要是去了澳洲,买软件肯定给人家钱的,哈哈。
回复  

使用道具 举报

您需要登录后才可以回帖 登录 | FreeOZ用户注册

本版积分规则

小黑屋|手机版|Archiver|FreeOZ论坛

GMT+11, 2-11-2024 18:32 , Processed in 0.033196 second(s), 18 queries , Gzip On, Redis On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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