首页
社区
课程
招聘
[讨论]int3/popf反调试
2008-11-21 17:04 5004

[讨论]int3/popf反调试

2008-11-21 17:04
5004
在shelllwolf 的 反调试技巧总结-原理和实现中有一段int3/popf反调试:
__asm
  {
    push   offset e_handler; set exception handler
    push  dword ptr fs:[0h]
    mov    dword ptr fs:[0h],esp  
    xor   eax,eax;reset EAX invoke int3
    int    3h
    pushfd
    nop
    nop
    nop
    nop
    pop    dword ptr fs:[0h];restore exception handler
    add   esp,4

    test   eax,eax; check the flag
    je    rf_label
    jmp    rt_label

e_handler:
    push   offset e_handler1; set exception handler
    push  dword ptr fs:[0h]
    mov    dword ptr fs:[0h],esp  
    xor   eax,eax;reset EAX invoke int3
    int    3h
    nop
    pop    dword ptr fs:[0h];restore exception handler
    add   esp,4
    ;EAX = ContextRecord
    mov    ebx,eax;dr0=>ebx
    mov   eax,dword ptr [esp+0xc]
    ;set ContextRecord.EIP
    inc   dword ptr [eax+0xb8];
    mov    dword ptr [eax+0xb0],ebx;dr0=>eax
    xor    eax,eax
    retn

e_handler1:
    ;EAX = ContextRecord
    mov   eax,dword ptr [esp+0xc]
    ;set ContextRecord.EIP
    inc   dword ptr [eax+0xb8];
    mov    ebx,dword ptr[eax+0x04]
    mov    dword ptr [eax+0xb0],ebx;dr0=>eax
    xor    eax,eax
    retn
rt_label:
    xor  eax,eax
    inc eax
    mov esp,ebp
    pop  ebp
    retn
rf_label:
    xor eax,eax
    mov esp,ebp
    pop ebp
    retn
  }
我在OllyICE上F9测试失败(没有hideod),跟直接运行一样

[培训]内核驱动高级班,冲击BAT一流互联网大厂工 作,每周日13:00-18:00直播授课

收藏
点赞0
打赏
分享
最新回复 (2)
雪    币: 2314
活跃值: (129)
能力值: (RANK:410 )
在线值:
发帖
回帖
粉丝
shellwolf 10 2008-11-21 17:35
2
0
唉,丑陋的代码.
我现在也看不懂了,你再研究下吧,可能有问题。回头我再试下。
雪    币: 331
活跃值: (57)
能力值: ( LV7,RANK:100 )
在线值:
发帖
回帖
粉丝
better 2 2008-11-21 18:21
3
0
难道只能Anti单步?
游客
登录 | 注册 方可回帖
返回