|
[原创]发个ARM指令集的Crack过程
终于你到这里发帖啦? 嘿嘿,身为南京的老兄表示happy 透露下BiNpDa进了目啊? 我s60 2nd的打过两个感觉比 s60 3rd的要简单许多, 本来我也想开发个s60.v2的逆向分析地, 可惜感觉太简单了就木发了。 s60.v2的关键api就是getmachineidl这个涵数, 用于获取手机串码imei滴,由于手机权限问题软件劫获硬件指纹大多都是串码 因此逆向分析的时候一般抓这里。 嘿嘿,k兄放个s60.v3的教程吧… 还有,有空在看雪发个完整的crack教程啦。 从解包,破解,汉化,打包的,图文要并貌哦! |
|
|
|
[注意]收集一下工具创意……
作个 系统吧~ |
|
|
|
纯脆灌水PE-LOCK1.0X
下面这个脚本是我写的 只修复了 ITA 和显示 要转存的 壳转移区段 也就是 转移的代码我还没让他 写回来,还有就是Stolen Code 还没完善! 这个是我以前分析的果果 00DD7890 6A 04 push 4 00DD7892 68 00300000 push 3000 00DD7897 68 28220000 push 2228 00DD789C 6A 00 push 0 00DD789E FF55 04 call dword ptr [ebp+4] ; 获取申请到的空间地址 00DD78A1 97 xchg eax, edi ; 把申请到的地址 给 EDI 00DD78A2 E8 E1FFFFFF call 00DD7888 00DD78A7 8D75 FB lea esi, dword ptr [ebp-5] 00DD78AA 81EE 45040000 sub esi, 445 00DD78B0 56 push esi 00DD78B1 BB 53000000 mov ebx, 53 00DD78B6 3017 xor byte ptr [edi], dl ; 将要写壳中代码的地址 与 上一次壳跳向源程序 "JMP XXX" 的操作数 异或 00DD78B8 47 inc edi ; 指向下一个 壳转移 指针 00DD78B9 8B16 mov edx, dword ptr [esi] ; 修改 JMP 到 壳中代码地址 00DD78BB 83C6 04 add esi, 4 ; 指向 壳代码 将要 从 某地方拷贝过来的数据长度 00DD78BE C602 E9 mov byte ptr [edx], 0E9 ; 可以理解代码段的写入 JMP 指令 00DD78C1 8BC7 mov eax, edi ; 将要写转移壳代码地址 -> EAX 00DD78C3 2BC2 sub eax, edx ; 求 原代码 到 壳中代码的 偏移 00DD78C5 83E8 05 sub eax, 5 ; 减去 "JMP XXX" 长度(纠正去壳地址) 00DD78C8 8942 01 mov dword ptr [edx+1], eax ; 在 JMP 指令后面写入 操作数 00DD78CB 8A06 mov al, byte ptr [esi] ; 将要复制的长度 给 al 00DD78CD 46 inc esi ; 指向要拷贝的数据 00DD78CE 0FB6C8 movzx ecx, al ; 将要 拷贝到壳代码的数据总长度 00DD78D1 83E0 03 and eax, 3 00DD78D4 C1E9 02 shr ecx, 2 ; ecx 右移2位 = int(ecx/2^2) 00DD78D7 F3:A5 rep movs dword ptr es:[edi], dword ptr >; 将 指向的复制数据 写到 壳转移代码 00DD78D9 8BC8 mov ecx, eax ; 上面类似于 取操作码 00DD78DB F3:A4 rep movs byte ptr es:[edi], byte ptr [e>; 类似取 操作数 00DD78DD 8A06 mov al, byte ptr [esi] ; 取 上 面 代码的长度 00DD78DF 46 inc esi ; 指向下一次 要复制 到 壳中的代码 00DD78E0 03D0 add edx, eax ; 准备在壳转移代码中 写 JMP 返回的地址 00DD78E2 C607 E9 mov byte ptr [edi], 0E9 ; 写 JMP 指令 00DD78E5 2BD7 sub edx, edi ; 求 壳代码 到 原代码的 偏移 00DD78E7 83EA 05 sub edx, 5 ; 减去 "JMP XXX" 长度(纠正返回地址) 00DD78EA 8957 01 mov dword ptr [edi+1], edx ; 在 JMP 指令后面写入 操作数 00DD78ED 83C7 05 add edi, 5 ; EDI 指向 下一个 写壳中代码的指针 00DD78F0 4B dec ebx ; 统计 壳转移了 多少次这样的代码 00DD78F1 ^ 75 C3 jnz short 00DD78B6 00DD78F3 5F pop edi 00DD78F4 8D4D 66 lea ecx, dword ptr [ebp+66] 00DD78F7 2BCF sub ecx, edi 00DD78F9 F3:AA rep stos byte ptr es:[edi] 00DD78FB 61 popad 00DD78FC C3 retn 我一开始想 从这里 直接把壳转移的信息 写到原程序的! 后来 看了一些 很多 壳里面的代码是 Lea XXXX Xxxxx 给 EAX,赋值的 所以 要写回源程序的 代码要 智能一点,直接 mov eax,xxxx 但是 好像好难,所以我只能从 补区段里面获取 这个!再补区段 最近,头比较乱,所以说话语无伦次. 呵呵,关注一下大牛 是如何还原代码的! /* ////////////////////////////////////////////////// PeLock 1.X UnPacK And Fix ITA ////////////////////////////////////////////////// */ CheckVersion: //检查 OllyScripts 插件版本 CMP $VERSION, "1.51" JAE Start //OllyScripts 插件版不小于1.51 MSG "OllyScripts 插件版本小于 1.51,请去 WwW.PeDIY.CoM 下载新版本" JMP stop stop: //结束脚本 CMT eip, "已经停止 脚本" RET Start: //数据初始化 //获取 代码段相关信息 VAR cdbs VAR cdss GMI eip, codeBASE MOV cdbs, $RESULT //获取 代码段基址 GMI eip, codesize MOV cdss, $RESULT //获取 代码段大小 //定义变量 VAR temp //临时变量 VAR CRC_Add //CRC 验证前一个异常地址 VAR CRC_Code_Add //转向 CRC 补丁地址 VAR CRC_Patch_Add //CRC 补丁地址 VAR Fix_ITA_Add //修复 ITA 的代码地址 //设置 OD BPMC //清楚 内存断点 BPHWCALL //清除所有硬件断电 DBH //隐藏 OD CMT eip, "开始执行 脚本" //批注 JMP Run_Script //执行 脚本 Run_Script: //执行脚本 MSGyn "是否执行脚本" CMP $RESULT,0 JNE Check //检查壳是否为 PeLock JMP stop Check: //检查 PELock 1.0x -> Bartosz Wojcik 特征指纹 FIND eip-5c,#4C6F61644C6962726172794100005669727475616C416C6C6F63004B45# CMP $RESULT,0 JNE Seach_CRC MSG "好像不是 PELock 1.0x -> Bartosz Wojcik 吧?" JMP stop Seach_CRC: // 查找 CRC 验证 前一个异常的地址 ESTO FIND eip,#8909# //查找特征代码 "MOV dword ptr [ecx], ecx" MOV CRC_Add,$RESULT CMP CRC_Add,eip JE Seach_CRC_Code //是否执行到 特征代码这里 JMP Seach_CRC Seach_CRC_Code: //查找 CRC代码地址 FIND eip,#2B848D143B0000# //查找特征代码 "SUB EAX,DWORD PTR SS:[EBP+ECX*4+3B14]" MOV CRC_Code_Add,$RESULT CMP CRC_Code_Add,0 JNE Seach_Fix_ITA_Add //是否检查到 特征代码 MSG "没有找到 CRC 代码效验地址" JMP stop Seach_Fix_ITA_Add: //查找 修复 ITA 的代码地址 FIND eip,#8919EB# //查找特征代码 "MOV DWORD PTR DS:[ECX],EBX" MOV Fix_ITA_Add,$RESULT CMP Fix_ITA_Add,0 JNE Come_CRC_Code //是否检查到 特征代码 MSG "没有找到 ITA 代码效验地址" JMP stop Come_CRC_Code: //自行到 进行CRC 验证的代码 bp CRC_Code_Add ESTO CMP CRC_Code_Add,eip JE Seach_CRC_Patch_Space //判断是否执行到 CRC 验证代码段 JMP Come_CRC_Code Seach_CRC_Patch_Space: //查找可用写 CRC 补丁的空间 GMEMI eip,MEMORYBASE MOV CRC_Patch_Add,$RESULT GMEMI eip,MEMORYSIZE ADD CRC_Patch_Add,$RESULT SUB CRC_Patch_Add,100 //CRC_PATCH 代码地址为 当前执行段末尾-100 CMP CRC_Patch_Add,0 JNE CRC_Patch_Code MSG "没有找到 CRC 补丁的空间" //检验是否找 CRC 补丁 补丁 地址 JMP stop CRC_Patch_Code: //CRC补丁代码 bc CRC_Code_Add MOV [CRC_Patch_Add],#81F948010000742481F985000000741681F98400000074082B848D143B0000C32D2B848D14C32D3B0000D3C32D8919EB03C30000# //CRC 补丁 MSG "CRC 补丁成功" MSG CRC_Patch_Add JMP FIX_CRC_Enter_Point FIX_CRC_Enter_Point: //修改 CRC 的入口 EVAL "call {CRC_Patch_Add}" ASM eip,$RESULT //修改 当前代码为 CALL CRC补丁地址 MOV temp,CRC_Code_Add ADD temp,5 MOV [temp],#9090# //把后面的两个字节用 NOP 覆盖 CMT eip,"修改 CRC 的入口" MSG "成功修改 CRC 的入口" JMP Seach_Fix_ITA Seach_Fix_ITA: //查找修复 ITA 的地址 bp Fix_ITA_Add ESTO CMP eip,Fix_ITA_Add JNE Seach_Fix_ITA //运行到 Fix_ITA 代码处 JMP Fix_ITA Fix_ITA: //修复 ITA bc Fix_ITA_Add ASM Fix_ITA_Add,"MOV DWORD PTR DS:[ECX],EAX" //修改 "MOV DWORD PTR DS:[ECX],EBX" 为 "MOV DWORD PTR DS:[ECX],EAX" CMT Fix_ITA_Add,"修复 ITA 地址" MOV temp,cdbs ADD temp,cdss //获取 代码段范围 存放再 temp 中 JMP Cater Cater: //异常处理过程 BPWM cdbs,cdss //代码段 内存写断点 ESTO COE Cater BPMC ret JMP Come_Code_Section Come_Code_Section: //设法通过 代码段 内存访问端点 使得 程序执行到 代码段 BPRM cdbs,cdss //代码段 内存访问断点 ESTO CMP eip,temp //验证程序是否自行到 代码段 JA Come_Code_Section CMP eip,cdbs JA YesCome JMP Come_Code_Section YesCome: #LOG LOG "ok" AN eip MSG "是否执行自动修复 Stolen Code(还没完善)" RET |
|
|
|
|
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值