|
|
|
[原创]突破封锁线:第一章--脱壳篇
【文章标题】: 脱壳篇[补]--修复代码脚本分析 【文章作者】: Austin 【作者邮箱】: austin.cn@gmail.com 【作者声明】: 技术交流中。。。 -------------------------------------------------------------------------------- 【详细过程】 阅读本文前最好先阅读OllyMachine手册,掌握基本命令。(OllyMachine是强大的OllyDbg脚本插件) 脚本的工作流程基本上就是从.text段的最开始搜索,找到有call 0061????形式的call就跟进去,找出被偷的代码,写回来。 搜索中使用了OllyMachine的Find函数,该函数寻找特定的命令字符。 下面逐行分析: ;修复代码1.TXT ;////////////////////////////////////////////////////// mov reg01, 0x00401030 ;//从00401030开始察看,也可以从00401000开始,不过前面确实没有 lp: ;//循环开始 add reg01, 5 ;//每次走5个字节 invoke Find, reg01, "e8????2000" ;//e8是call的机器码,后面跟的是跳转的偏移量。??代表任意一个字节 cmp reg00, -1 ;//注意偏移量是反序,即高位在后。所以一个0020????的偏移量写成了????2000 je end1 ;//若找不到,则跳转到结束 mov reg01, reg00 ;//将找到的地址存入reg01,则reg01指向一个形如call 0061????的指令 invoke printbuftodump, reg01 ;//打印到数据窗口察看 ;invoke printbuf, reg01, 5 ;invoke MsgYn, "Process?" ;or reg00, 0 ;je lp mov reg02, reg01 ;//将reg01存到reg02 inc reg02 ;//reg02增加一个字节,则它指向 0020????这个偏移量 invoke readmemlong, reg02, 4 ;//将这个偏移量读入reg00 mov reg03, reg00 ;//存入reg03中 ;invoke printnum, reg01, 16 ;invoke printnum, reg03, 16 add reg03, reg01 add reg03, 5 ;//此时reg03已经是跳转到的指令地址,形如jmp[15????] add reg03, 2 ;//再向前两个字节,reg03指向 15????的地址 invoke printbuftodump, reg03 ;//打印 invoke readmemlong, reg03, 4 ;//将 15????这个数值读入reg00 mov reg04, reg00 ;//存入reg04备用 invoke readmemlong, reg04, 4 ;//将15????指向的地址读入reg00 mov reg05, reg00 ;//存入reg05备用 invoke printbuftodump, reg05 ;//打印 ;invoke printbuf, reg05, 5 ;invoke MsgYn, "Process?" ;or reg00, 0 ;je lp invoke readmemlong , reg05, 4 ;//读出真正指令的前4个字节,共五个,但一次最多读4个。所以分两次来做。 invoke writememlong, reg01, reg00, 4 ;//将这4个字节写回.text段中 add reg01, 4 ;//后移4个字节 add reg05, 4 invoke readmemlong, reg05, 1 invoke writememlong, reg01, reg00, 1 ;//读出和写入最后一个字节 sub reg01, 4 invoke printbuftodump, reg01 ;//打印 ;invoke MsgYn, "Continue?" ;or reg00, 0 jne lp ;//循环继续 end1: ;////////////////////////////////////////////////////// -------------------------------------------------------------------------------- 【经验总结】 使用脚本可以使我们破解工作的繁重程度大大减轻,自动化程度大大提高。 -------------------------------------------------------------------------------- 【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢! 2006年04月28日 23:18:20[CODE] |
|
[分享]API_Break 1.2 (OD插件) 发布
感谢楼主的分享 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值