首页
社区
课程
招聘
我也来炒现饭,在角落里发现了两个脚本
2005-4-21 13:32 8513

我也来炒现饭,在角落里发现了两个脚本

2005-4-21 13:32
8513

/*
//////////////////////////////////////////////////
        Armadillo 3.x DLL Unpacking script v0.1
        Author:        loveboom
        Email : loveboom%163.com
        OS    : WinXP sp2,Ollydbg 1.1,OllyScript v0.92
        Date  : 2005-03-07
        Action: Auto fix IAT,find oep
        Config: Ignore all exceptions and ingnore exception: 'C000001E (INVALID LOCK SEQUENCE)'
        Note  : If you have one or more question, email me please,thank you!
//////////////////////////////////////////////////
*/
var addr                //addr
var gmaddr                //GetModuleHandleA's address
var fillvalue
var cbase
var csize
var count
var relocaddr
var relocsize

start:
  msgyn "Setting: Ignore all exceptions and ingnore exception: 'C000001E (INVALID LOCK SEQUENCE)',continue?"
  cmp $RESULT,1
  JE lblgetinfo1
  ret

lblgetinfo1:                //获取code base
  ask "请输入.text段的起始地址:"
  cmp $RESULT,0
  jne lblsetvalue1
  ret

lblsetvalue1:
  mov cbase,$RESULT

lblgetinfo2:                        //获取CODE SIZE
  ask "请输入.text段的大小:"
  cmp $RESULT,0
  jne lblsetvalue2
  ret

lblsetvalue2:
  mov csize,$RESULT

LBL1:
  dbh
  mov count,0
  gpa "GetModuleHandleA","kernel32.dll"
  mov gmaddr,$RESULT
  bphws gmaddr,"x"

lbl2:
  esto
  
lblcmp:
  mov addr,esp
  add addr,8
  mov addr,[addr]
  mov addr,[addr]
  cmp addr,74726956
  jne lbl2
  inc count
  cmp count,2
  jne lbl2
  esto
  rtu

lbl3:
  bphwc gmaddr
  find eip,#0F84#
  cmp $RESULT,0
  je lblabort
  mov addr,$RESULT
  fill addr,1,90
  inc addr
  fill addr,1,e9
  rtr
  sto
  mov count,5

lblloop:
  find eip,#6A00FF35#
  go $RESULT
  findop eip,#7436#
  go $RESULT
  dec count
  cmp count,0
  je lblbreak
  jmp lblloop

lblbreak:
/*
        MOV EAX,DWORD PTR DS:[1080030]
        MOV EAX,DWORD PTR DS:[EAX]
        MOV DWORD PTR SS:[EBP-37D0],EAX          ; eax==重定位开始地址
        MOV EAX,DWORD PTR DS:[1080030]
        ADD EAX,4
        MOV DWORD PTR DS:[1080030],EAX
        MOV EAX,DWORD PTR DS:[1080030]
        MOV EAX,DWORD PTR DS:[EAX]
        MOV DWORD PTR SS:[EBP-3798],EAX          ; EAX==重定位大小
        MOV EAX,DWORD PTR DS:[1080030]
        ADD EAX,4
        MOV DWORD PTR DS:[1080030],EAX
        CMP DWORD PTR SS:[EBP-37D0],0            ; 判断重定位地址是否为空
        JE SHORT 01067CCD
        CMP DWORD PTR SS:[EBP-3798],0            ; 判断重定位大小是否为空
        JE SHORT 01067CCD
*/
  find eip,#A1????????8B008985????????A1????????83C004A3????????A1????????8B008985????????A1????????83C004#
  cmp $RESULT,0
  je lblabort
  go $RESULT
  sto
  sto
  mov relocaddr,eax
  sto
  find eip,#8985#
  go $RESULT
  mov relocsize,eax
  find eip,#74??83BD????????0074#
  cmp $RESULT,0
  je lblabort
  mov addr,$RESULT
  add addr,B
  find addr,#74#
  cmp $RESULT,0
  je lblabort
  fill $RESULT,1,EB
  bprm cbase,csize
  
lbl4:
  esto

lbl5:
  find eip,#558BEC#
  cmp $RESULT,0
  je lbl4
  cmp $RESULT,eip
  jne lbl4
  bpmc

lblend:
  cmt eip,"程序oep"
  eval "这个DLL文件的重定位地址VA是: {relocaddr}.大小为: {relocsize}"
  msg $RESULT
  msg "Script by loveboom[DFCG][FCG][US],thank you for using my script!"
  ret

lblabort:
  msg "Error!Script aborted.Maybe target is not protect by arm 3.x or user aborted!"
  ret
//-------------------------------------------------------------

/*
//////////////////////////////////////////////////
        MSLRH v0.31A unpack script v0.1
        Author:        loveboom
        Email : loveboom%163.com
        OS    : WinXP sp2,Ollydbg 1.1,OllyScript v0.92
        Date  : 2005-03-07
        Action: Auto fix IAT,find oep
        Config: Ignore all exceptions and ingnore exception: 'C000001E (INVALID LOCK SEQUENCE)'
        Note  : If you have one or more question, email me please,thank you!
//////////////////////////////////////////////////
*/
var addr
var espval
var cbase
var csize
var peheader
var mbase

start:
  msgyn "Setting:Ignore all exceptions.continue?"
  cmp $RESULT,1
  je lbl1
  ret

lbl1:
  dbh
  mov espval,esp                //Get esp value
  sub espval,4
  gmi eip,MODULEBASE                //Get code section information
  mov mbase,$RESULT
  mov peheader,mbase
  add peheader,3c
  mov addr,[peheader]
  add addr,mbase
  mov peheader,addr                //Get pe header
  
  add peheader,100                //Get section size
  mov csize,[peheader]

  add peheader,4                //Get section VirutalAddress
  mov cbase,[peheader]
  add cbase,mbase

  
lbl2:
  gpa "OutputDebugStringA","kernel32.dll"
  cmp $RESULT,0
  je lbl3
  mov addr,$RESULT
  asm addr,"xor eax,eax"        //Patch api function
  add addr,2
  asm addr, "ret 4"
  
lbl3:
  gpa "CreateFileA","kernel32.dll"
  bp $RESULT
  esto
  bc $RESULT
  rtu
  
lbl4:                        //clear anti-ImportREC
  mov addr,eax
  exec
    push {addr}
    Call CloseHandle
  ende

lbl5:
  gpa "ZwQueryInformationProcess","ntdll.dll"                //Clear Anti-Ring3 debug
  cmp $RESULT,0
  je lbl6
  bp $RESULT
  esto
  bc $RESULT
  rtu
  sto
  mov eax,0
  
lbl6:
  bprm cbase,csize
  esto
  bpmc
  bphws espval,"r"
  esto
  bphwc espval
  sto
  
lblend:
  dbs
  cmt eip,"OEP"
  msg "Script by loveboom[DFCG][FCG][US],thank you for using my script!"
  ret

[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法

收藏
点赞7
打赏
分享
最新回复 (10)
雪    币: 266
活跃值: (191)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
二点 1 2005-4-21 13:37
2
0
强!
雪    币: 1159
活跃值: (1720)
能力值: ( LV12,RANK:770 )
在线值:
发帖
回帖
粉丝
fxyang 19 2005-4-21 14:48
3
0
学习!
雪    币: 214
活跃值: (100)
能力值: ( LV6,RANK:90 )
在线值:
发帖
回帖
粉丝
randomizer 2 2005-4-21 15:20
4
0
xuexi xuexi!

脚落=角落
呵呵
雪    币: 450
活跃值: (552)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
winndy 17 2005-4-21 15:22
5
0
知识不会过期~~
好好学习!
雪    币: 513
活跃值: (2228)
能力值: ( LV9,RANK:2130 )
在线值:
发帖
回帖
粉丝
loveboom 53 2005-4-21 15:59
6
0
想了半天还是没有想出角字怎么打
谢谢randomizer
雪    币: 85309
活跃值: (198610)
能力值: (RANK:10 )
在线值:
发帖
回帖
粉丝
linhanshi 2005-4-21 18:15
7
0
THANKS!!!
雪    币: 61
活跃值: (160)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
pendan2001 4 2005-4-21 19:57
8
0
学习
雪    币: 221
活跃值: (137)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
xsy3660 4 2005-4-21 22:22
9
0
支持,下了慢慢学习一下脚本的书写
雪    币: 203
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
bokonger 2005-5-14 10:31
10
0
lblgetinfo1:    //获取code base
  ask "请输入.text段的起始地址:"
  cmp $RESULT,0
  jne lblsetvalue1
  ret
雪    币: 528
活跃值: (19)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
gxggxy103 2005-5-14 13:03
11
0
THANKS!!!
游客
登录 | 注册 方可回帖
返回