Date: 2007-03-25 Script:PELock 1.0x -> Bartosz Wojcik IAT Fixer Action: Auto fix IAT、 Remote Jump、Go to OEP Environment : OllyDbg 1.1, ODBGScript 1.52,Winxp Sp2 Debugging options: Tick all items in OllyDbg's Debugging Options-Exceptions
Thanks : kanxue - author of HideOD hnhuqiong - author of ODbgScript 1.52 */
var CrCAddr var IATAddr var MovAddr var ibase var cbase var csize var CodAddr var VirtualAddr var TempAdd var IATStart var IncTime var othertime var AllocTemp var EndAddr var replAddr
GetBase: dbh GMI eip, MODULEBASE cmp $RESULT,0 je Abort mov ibase,$RESULT GMI eip,CODEBASE //Get code base cmp $RESULT,0 je Abort mov cbase,$RESULT GMI eip, codesize cmp $RESULT,0 je Abort mov csize,$RESULT mov IncTime,0 mov othertime,0 jmp GetAddr
GetAddr: esto inc IncTime cmp IncTime,3 je CrCother find eip,#2B848D143B0000# cmp $RESULT,0 je GetAddr mov CrCAddr,$RESULT find eip,#C602E98BC72BC283E805894201# cmp $RESULT,0 je Abort sub $RESULT,2F mov MovAddr,$RESULT jmp FindIAT
FindIAT: find eip,#8919# cmp $RESULT,0 je IATOther mov IATAddr,$RESULT bp CrCAddr bp IATAddr jmp Exception
//若IAT没有加密,则直接去修复“跳转表” IATOther: find eip,#8901# cmp $RESULT,0 MSGYN "是否尝试修复壳数据转移?" cmp $RESULT, 1 je FixCode add MovAddr,2F bp MovAddr jmp MemPoint
//Crc的另外一个特征码 CrCother: esto inc othertime cmp othertime,3 je Abort find eip,#2B848D5C310000# cmp $RESULT,0 mov CrCAddr,$RESULT je CrCother find eip,#C602E98BC72BC283E805894201# cmp $RESULT,0 je Abort sub $RESULT,2F mov MovAddr,$RESULT bp MovAddr jmp FindIAT
Exception: cmp eip,CrCAddr je FixIAT esto jmp Exception
FixIAT: bc IATAddr repl IATAddr,#8919#,#8901#,2 jmp FixCrc
FixCrc: bc CrCAddr Alloc 1000 //申请一个内存空间 mov AllocTemp,$RESULT mov [AllocTemp],#81F948010000742481F985000000741681F98400000074082B848D143B0000C32D2B848D14C32D3B0000D3C32D8919EB03C30000# eval "call {AllocTemp}" asm CrCAddr,$RESULT mov TempAdd, CrCAddr add TempAdd,5 mov [TempAdd],#9090# bp CrCAddr esto bc CrCAddr bp IATAddr esto cmp eip,IATAddr mov IATStart,ecx bc IATAddr MSGYN "是否尝试修复壳数据转移?" cmp $RESULT, 1 je FixCode add MovAddr,2F bp MovAddr jmp MemPoint
FixCode: bp MovAddr esto cmp eip,MovAddr jne FixCode bc MovAddr mov replAddr,MovAddr add replAddr,27 mov [replAddr],#9090# add replAddr,8 bp replAddr esto bc replAddr mov [replAddr],#8BFA90# add replAddr,0A mov [replAddr],#909090# add replAddr,1A mov [replAddr],#909090# add replAddr,08 mov [replAddr],#909090# free AllocTemp, 1000 //释放掉申请的空间 mov CodAddr,edi sub CodAddr,1 mov eip,CodAddr mov [CodAddr],#EB058B1683C6048BFA0FB60646803E8D7415508BC883E003C1E902# add CodAddr,1B mov [CodAddr],#F3A58BC8F3A45A469090EB475033D233C9B106F7F18BC80FB646018AE0# add CodAddr,1D mov [CodAddr],#68252D353D68050D151DB0B833D238241474079090FEC042EBF45A# add CodAddr,1B mov [CodAddr],#5A25FF0000005033C08B560203C283C606E2F65A8817894701465A4B# add CodAddr,1C mov [CodAddr],#75915F8D4D662BCFF3AA61C3# add CodAddr,0B bp CodAddr esto bc CodAddr BPRM cbase,csize mov EndAddr,cbase add EndAddr,csize jmp Final
MemPoint: esto cmp eip,MovAddr jne MemPoint bc MovAddr esto BPRM cbase,csize mov EndAddr,cbase add EndAddr,csize jmp Final
Abort: MSG "版本不对应:(" ret
Final: esto cmp eip,EndAddr ja Final cmp eip,cbase ja Done jb Final