【文章标题】: 详细脱 Armadillo find protected 1.3
【文章作者】: Cater
【作者邮箱】: [email]24882688@qq.com[/email]
【作者主页】: Cater.MicroSoft.com
【作者QQ号】: 24882688
【软件名称】: Armadillo find protected 1.3
【下载地址】: http://www.pediy.com/tools/unpack/Armadillo/armafp/armafp.zip
【保护方式】: WinUpack 0.39 + PeCompact + 输入表
【使用工具】: OD,LoadPE,ImportREC,DIYTools
【操作平台】: XP SP2
【软件介绍】: 检测 Armadillo版本号及其保护类型
【作者声明】: 我是榨菜,献给广大菜鸟
--------------------------------------------------------------------------------
【详细过程】
献给 菜鸟们学习,大虾勿笑!
故事由来:
想汉化 Armadillo find protected 1.3
初次体验:
挫败,挫败^24882688
失败原因:
输入表一部分被转移到别的地方了。
我的对策:
Dump+Patch
运行步骤:
1.Dump
OD
加载
一个错误后来到
00401018 > BE B0114000
mov esi,ArmaFP.004011B0 //
这里
0040101D AD
lods dword ptr ds:[
esi]
0040101E 50
push eax
0040101F FF76 34
push dword ptr ds:[
esi+34]
00401022 EB 7C
jmp short ArmaFP.004010A0
手动跟踪
程序自己截压出代码
004105D6 FFD5
call ebp
004105D8 AB
stos dword ptr es:[
edi]
004105D9 ^ EB E7
jmp short 004105C2
004105DB C3
retn // WinUpack
结束
F8
来到
004028C5 B8 0CA64000
mov eax, 0040A60C //
个人感觉是 PeCompact 的代码没有测试过
004028CA 50
push eax
004028CB 64:FF35 0000000>
push dword ptr fs:[0]
004028D2 64:8925 0000000>
mov fs:[0],
esp
试下 HE EIP
直接 断在 OEP
004028C5 55
push ebp //
断在这里拉 ; kernel32.GetProcAddress
004028C6 8BEC
mov ebp,
esp
004028C8 6A FF
push -1
004028CA 68 18514000
push 00405118
004028CF 68 94414000
push 00404194
004028D4 64:A1 00000000
mov eax,
fs:[0]
004028DA 50
push eax
004028DB 64:8925 0000000>
mov fs:[0],
esp
不要说了,肯定是 VC 的程序,看头就知道了,
说道这里,我觉得真是郁闷哦,某人的 完美 Pelock 脱壳秀,
里面的 Push -1 我又不能理解是什么意思 注意 是 又 不能理解了!
呵呵~
废话到这里 LoadPe dump ,ImportREC 修复下!
注意 OD 暂时不惯!
2.Patch
代码
a.
先找到 被转移的 输入表
运行 dumped_.exe 程序出错,再打开一个OD 调试!
设置,除了 特权指令的那个不选,其他异常全选!
F9
运行 发现错误
堆栈里显示 信息如下
0012FF48 004028F1
返回到 dumped_.004028F1 来自 00B000B6
0012FF4C 7C930738 ntdll.7C930738
0012FF50 FFFFFFFF
我们去 004028F1,向上找第一个 call,下断点
004028E7 57
push edi
004028E8 8965 E8
mov [
ebp-18],
esp
004028EB FF15 68504000
call [405068] //
这里断点
004028F1 33D2
xor edx,
edx
004028F3 8AD4
mov dl,
ah
好了重新 调试 Dumper_.exe
程序 如愿 在 004028EB 断下!
F7
来到
00B000B6 0000
add [
eax],
al //
这里
00B000B8 0000
add [
eax],
al
此时我们给前面那个还挂着 原程序的 OD
在 004028EB 下断点 运行,F7 来到
00B100B6 B8 AB14817C
mov eax, kernel32.GetVersion //
这里
00B100BB FFE0
jmp eax
00B100BD B8 407A957C
mov eax, ntdll.RtlUnwind
00B100C2 FFE0
jmp eax
00B100C4 B8 6910817C
mov eax, kernel32.GetFileType
哎?原来这里 就是转移过来的输入表!
而 我们 Dumped_.exe 里面却没有这份输入表啊,怎么办!
我人蠢,选择 patch 代码!
b.
保存 被转移的 输入表
将
这个有 输入表的 代码从 B10000 到 B10200前一行 选中,右键 二进制,二进制复制
保存成个 ITA.TXT 文本文档
ITA.TXT
如下:
B8 2B 2E 83 7C FF E0 B8 77 9B 80 7C FF E0 B8 9F 0F 81 7C FF E0 B8 E0 C6 80 7C FF E0 B8 24 1A 80
7C FF E0 B8 57 B3 80 7C FF E0 B8 29 B5 80 7C FF E0 B8 0E 18 80 7C FF E0 B8 8F 0C 81 7C FF E0 B8
0F 22 80 7C FF E0 B8 CC 21 80 7C FF E0 B8 16 1E 80 7C FF E0 B8 79 E0 81 7C FF E0 B8 31 03 93 7C
FF E0 B8 4D A3 85 7C FF E0 B8 49 28 86 7C FF E0 B8 EB 8E 83 7C FF E0 B8 68 A2 85 7C FF E0 B8 67
23 80 7C FF E0 B8 A6 0D 81 7C FF E0 B8 66 AA 80 7C FF E0 B8 25 04 38 00 FF E0 B8 77 1D 80 7C FF
E0 B8 A2 CA 81 7C FF E0 B8 8D 2C 81 7C FF E0 B8 E6 2B 81 7C FF E0 B8 AB 14 81 7C FF E0 B8 40 7A
95 7C FF E0 B8 69 10 81 7C FF E0 B8 A9 2C 81 7C FF E0 B8 CF C6 80 7C FF E0 B8 78 2C 81 7C FF E0
B8 AD 9C 80 7C FF E0 B8 C4 CE 80 7C FF E0 B8 C1 C9 80 7C FF E0 B8 2A E8 81 7C FF E0 B8 43 99 80
7C FF E0 B8 80 A4 80 7C FF E0 B8 B9 8C 83 7C FF E0 B8 10 11 81 7C FF E0 B8 C7 A0 80 7C FF E0 B8
3D 04 93 7C FF E0 B8 D4 05 93 7C FF E0 B8 EE 1E 80 7C FF E0 B8 23 CC 81 7C FF E0 B8 3F DC 81 7C
FF E0 B8 5F 48 81 7C FF E0 B8 8A 2B 86 7C FF E0 B8 29 29 81 7C FF E0 B8 14 9B 80 7C FF E0 B8 81
9A 80 7C FF E0 B8 FD 79 93 7C FF E0 B8 0D E0 80 7C FF E0 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
为什么选从 B10000 到 B10200 ,因为 大小 好计算 正好 0x200
c.patch
代码
先把 dumped_.exe 复制一份 改名 cater.exe
用 DIYTools 增加一个区段
名字 .Patch
大小 200(Hex)
注意 看下 .Patch 区段的 VOffset虚拟地址 0001A000
确定
LoadPe
把入口点 000028C5 改成 0001A000 保存确定.
补丁代码的大致结构如下
PUSHAD 保存当前寄存器
MOV ECX,200
ECX 取 补丁数据长度(也就是被转移走的那个 ITA大小 B10200-B10000=0x200 )
MOV ESI,41A100
取补丁数据的起始地址
MOV EAX,[405068]
EAX 取 GetVersion 输入表代码地址 00B000B6
SUB EAX,0B6
EAX 减去 B6 得到 00B10000 我们要补丁的代码开头
MOV EDI,
EAX 让 EDI 为 我们 要修改代码的起始地址
CLD 让 ESI 和 ESI 自加
rep movs byte ptr es:[
edi],
byte ptr ds:[
esi]
把 ESI 指向的数据 复制到 EDI 指向的地址
POPAD 凶案现场还原
JMP 4028C5
跳转真正的 OEP
好 OD 加载 cater.exe
现在的入口点在
0041A000 > 0000
add byte ptr ds:[
eax],
al //
这里
0041A002 0000
add byte ptr ds:[
eax],
al
好,手动输入以上代码
如下
0041A000 > 60
pushad
0041A001 B9 00020000
mov ecx,200
0041A006 BF 00101A04
mov esi,41A100
0041A00B A1 68504000
mov eax,
dword ptr ds:[405068]
0041A010 2D B6000000
sub eax,0B6
0041A015 8BF0
mov edi,
eax
0041A017 FC
cld
0041A018 F3:A4
rep movs byte ptr es:[
edi],
byte ptr>
0041A01A 61
popad
0041A01B - E9 A588FEFF
jmp 复件_dum.004028C5
二进制代码如下
60 B9 00 02 00 00 BE 00 A1 41 00 A1 68 50 40 00 2D B6 00 00 00 8B F8 FC F3 A4 61 E9 A5 88 FE FF
把他们选中 右键 复制到可以行文件 保存为 upack1.exe
再次加载 unpack1.exe
把 ITA.TXT 里面的数据复制,在 41A100 处选取200 字节,右键二进制粘贴
显示如下,
0041A100 B8 2B2E837C
mov eax,kernel32.LCMapStringA
0041A105 FFE0
jmp eax
0041A107 B8 779B807C
mov eax,kernel32.CloseHandle
0041A10C FFE0
jmp eax
0041A10E B8 9F0F817C
mov eax,kernel32.WriteFile
0041A113 FFE0
jmp eax
0041A115 B8 E0C6807C
mov eax,kernel32.lstrlenA
0041A11A FFE0
jmp eax
0041A11C B8 241A807C
mov eax,kernel32.CreateFileA
0041A121 FFE0
jmp eax
0041A123 B8 57B3807C
mov eax,kernel32.GetModuleFileNameA
0041A128 FFE0
jmp eax
0041A12A B8 29B5807C
mov eax,kernel32.GetModuleHandleA
0041A12F FFE0
jmp eax
0041A131 B8 0E18807C
mov eax,kernel32.ReadFile
0041A136 FFE0
jmp eax
0041A138 B8 8F0C817C
mov eax,kernel32.GetFileSize
0041A13D FFE0
jmp eax
0041A13F B8 0F22807C
mov eax,kernel32.WriteProcessMemory
0041A144 FFE0
jmp eax
0041A146 B8 CC21807C
mov eax,kernel32.ReadProcessMemory
0041A14B FFE0
jmp eax
0041A14D B8 161E807C
mov eax,kernel32.TerminateProcess
0041A152 FFE0
jmp eax
0041A154 B8 79E0817C
mov eax,kernel32.OpenProcess
0041A159 FFE0
jmp eax
0041A15B B8 3103937C
mov eax,ntdll.RtlGetLastWin32Error
0041A160 FFE0
jmp eax
0041A162 B8 4DA3857C
mov eax,kernel32.ContinueDebugEvent
0041A167 FFE0
jmp eax
0041A169 B8 4928867C
mov eax,kernel32.SetThreadContext
0041A16E FFE0
jmp eax
0041A170 B8 EB8E837C
mov eax,kernel32.GetThreadContext
0041A175 FFE0
jmp eax
0041A177 B8 68A2857C
mov eax,kernel32.WaitForDebugEvent
0041A17C FFE0
jmp eax
0041A17E B8 6723807C
mov eax,kernel32.CreateProcessA
0041A183 FFE0
jmp eax
0041A185 B8 A60D817C
mov eax,kernel32.SetFilePointer
0041A18A FFE0
jmp eax
0041A18C B8 66AA807C
mov eax,kernel32.FreeLibrary
0041A191 FFE0
jmp eax
0041A193 B8 25043800
mov eax,380425
0041A198 FFE0
jmp eax
0041A19A B8 771D807C
mov eax,kernel32.LoadLibraryA
0041A19F FFE0
jmp eax
0041A1A1 B8 A2CA817C
mov eax,kernel32.ExitProcess
0041A1A6 FFE0
jmp eax
0041A1A8 B8 8D2C817C
mov eax,kernel32.GetCommandLineA
0041A1AD FFE0
jmp eax
0041A1AF B8 E62B817C
mov eax,kernel32.GetCPInfo
0041A1B4 FFE0
jmp eax
0041A1B6 B8 AB14817C
mov eax,kernel32.GetVersion
0041A1BB FFE0
jmp eax
0041A1BD B8 407A957C
mov eax,ntdll.RtlUnwind
0041A1C2 FFE0
jmp eax
0041A1C4 B8 6910817C
mov eax,kernel32.GetFileType
0041A1C9 FFE0
jmp eax
0041A1CB B8 A92C817C
mov eax,kernel32.GetStdHandle
0041A1D0 FFE0
jmp eax
0041A1D2 B8 CFC6807C
mov eax,kernel32.SetHandleCount
0041A1D7 FFE0
jmp eax
0041A1D9 B8 782C817C
mov eax,kernel32.GetEnvironmentStri>
0041A1DE FFE0
jmp eax
0041A1E0 B8 AD9C807C
mov eax,kernel32.MultiByteToWideCha>
0041A1E5 FFE0
jmp eax
0041A1E7 B8 C4CE807C
mov eax,kernel32.LCMapStringW
0041A1EC FFE0
jmp eax
0041A1EE B8 C1C9807C
mov eax,kernel32.GetLocalTime
0041A1F3 FFE0
jmp eax
0041A1F5 B8 2AE8817C
mov eax,kernel32.GetOEMCP
0041A1FA FFE0
jmp eax
0041A1FC B8 4399807C
mov eax,kernel32.GetACP
0041A201 FFE0
jmp eax
0041A203 B8 80A4807C
mov eax,kernel32.GetStringTypeW
0041A208 FFE0
jmp eax
0041A20A B8 B98C837C
mov eax,kernel32.GetStringTypeA
0041A20F FFE0
jmp eax
0041A211 B8 1011817C
mov eax,kernel32.HeapDestroy
0041A216 FFE0
jmp eax
0041A218 B8 C7A0807C
mov eax,kernel32.WideCharToMultiByt>
0041A21D FFE0
jmp eax
0041A21F B8 3D04937C
mov eax,ntdll.RtlFreeHeap
0041A224 FFE0
jmp eax
0041A226 B8 D405937C
mov eax,ntdll.RtlAllocateHeap
0041A22B FFE0
jmp eax
0041A22D B8 EE1E807C
mov eax,kernel32.GetStartupInfoA
0041A232 FFE0
jmp eax
0041A234 B8 23CC817C
mov eax,kernel32.GetEnvironmentStri>
0041A239 FFE0
jmp eax
0041A23B B8 3FDC817C
mov eax,kernel32.FreeEnvironmentStr>
0041A240 FFE0
jmp eax
0041A242 B8 5F48817C
mov eax,kernel32.FreeEnvironmentStr>
0041A247 FFE0
jmp eax
0041A249 B8 8A2B867C
mov eax,kernel32.UnhandledException>
0041A24E FFE0
jmp eax
0041A250 B8 2929817C
mov eax,kernel32.HeapCreate
0041A255 FFE0
jmp eax
0041A257 B8 149B807C
mov eax,kernel32.VirtualFree
0041A25C FFE0
jmp eax
0041A25E B8 819A807C
mov eax,kernel32.VirtualAlloc
0041A263 FFE0
jmp eax
0041A265 B8 FD79937C
mov eax,ntdll.RtlReAllocateHeap
0041A26A FFE0
jmp eax
0041A26C B8 0DE0807C
mov eax,kernel32.GetCurrentProcess
0041A271 FFE0
jmp eax
0041A273 0000
add byte ptr ds:[
eax],
al
0041A275 0000
add byte ptr ds:[
eax],
al
0041A277 0000
add byte ptr ds:[
eax],
al
0041A279 0000
add byte ptr ds:[
eax],
al
0041A27B 0000
add byte ptr ds:[
eax],
al
0041A27D 0000
add byte ptr ds:[
eax],
al
0041A27F 0000
add byte ptr ds:[
eax],
al
0041A281 0000
add byte ptr ds:[
eax],
al
0041A283 0000
add byte ptr ds:[
eax],
al
0041A285 0000
add byte ptr ds:[
eax],
al
0041A287 0000
add byte ptr ds:[
eax],
al
0041A289 0000
add byte ptr ds:[
eax],
al
0041A28B 0000
add byte ptr ds:[
eax],
al
0041A28D 0000
add byte ptr ds:[
eax],
al
0041A28F 0000
add byte ptr ds:[
eax],
al
0041A291 0000
add byte ptr ds:[
eax],
al
0041A293 0000
add byte ptr ds:[
eax],
al
0041A295 0000
add byte ptr ds:[
eax],
al
0041A297 0000
add byte ptr ds:[
eax],
al
0041A299 0000
add byte ptr ds:[
eax],
al
0041A29B 0000
add byte ptr ds:[
eax],
al
0041A29D 0000
add byte ptr ds:[
eax],
al
0041A29F 0000
add byte ptr ds:[
eax],
al
0041A2A1 0000
add byte ptr ds:[
eax],
al
0041A2A3 0000
add byte ptr ds:[
eax],
al
0041A2A5 0000
add byte ptr ds:[
eax],
al
0041A2A7 0000
add byte ptr ds:[
eax],
al
0041A2A9 0000
add byte ptr ds:[
eax],
al
0041A2AB 0000
add byte ptr ds:[
eax],
al
0041A2AD 0000
add byte ptr ds:[
eax],
al
0041A2AF 0000
add byte ptr ds:[
eax],
al
0041A2B1 0000
add byte ptr ds:[
eax],
al
0041A2B3 0000
add byte ptr ds:[
eax],
al
0041A2B5 0000
add byte ptr ds:[
eax],
al
0041A2B7 0000
add byte ptr ds:[
eax],
al
0041A2B9 0000
add byte ptr ds:[
eax],
al
0041A2BB 0000
add byte ptr ds:[
eax],
al
0041A2BD 0000
add byte ptr ds:[
eax],
al
0041A2BF 0000
add byte ptr ds:[
eax],
al
0041A2C1 0000
add byte ptr ds:[
eax],
al
0041A2C3 0000
add byte ptr ds:[
eax],
al
0041A2C5 0000
add byte ptr ds:[
eax],
al
0041A2C7 0000
add byte ptr ds:[
eax],
al
0041A2C9 0000
add byte ptr ds:[
eax],
al
0041A2CB 0000
add byte ptr ds:[
eax],
al
0041A2CD 0000
add byte ptr ds:[
eax],
al
0041A2CF 0000
add byte ptr ds:[
eax],
al
0041A2D1 0000
add byte ptr ds:[
eax],
al
0041A2D3 0000
add byte ptr ds:[
eax],
al
0041A2D5 0000
add byte ptr ds:[
eax],
al
0041A2D7 0000
add byte ptr ds:[
eax],
al
0041A2D9 0000
add byte ptr ds:[
eax],
al
0041A2DB 0000
add byte ptr ds:[
eax],
al
0041A2DD 0000
add byte ptr ds:[
eax],
al
0041A2DF 0000
add byte ptr ds:[
eax],
al
0041A2E1 0000
add byte ptr ds:[
eax],
al
0041A2E3 0000
add byte ptr ds:[
eax],
al
0041A2E5 0000
add byte ptr ds:[
eax],
al
0041A2E7 0000
add byte ptr ds:[
eax],
al
0041A2E9 0000
add byte ptr ds:[
eax],
al
0041A2EB 0000
add byte ptr ds:[
eax],
al
0041A2ED 0000
add byte ptr ds:[
eax],
al
0041A2EF 0000
add byte ptr ds:[
eax],
al
0041A2F1 0000
add byte ptr ds:[
eax],
al
0041A2F3 0000
add byte ptr ds:[
eax],
al
0041A2F5 0000
add byte ptr ds:[
eax],
al
0041A2F7 0000
add byte ptr ds:[
eax],
al
0041A2F9 0000
add byte ptr ds:[
eax],
al
0041A2FB 0000
add byte ptr ds:[
eax],
al
0041A2FD 0000
add byte ptr ds:[
eax],
al
0041A2FF 0000
add byte ptr ds:[
eax],
al
0041A301 0000
add byte ptr ds:[
eax],
al
好了 复制成可执行文件 保存为。 unpacked.exe
--------------------------------------------------------------------------------
【经验总结】
一句话,感觉费劲
不知道,你们是怎么解决次类问题的!
求助中
--------------------------------------------------------------------------------
【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢! 2006
年08月04日 4:09:44
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)