找回密码
 注册
搜索
热搜: 回贴

用单步跟踪Anti-Debugger,Anti-Debugger,反跟踪技术

2010-1-30 18:16| 发布者: admin| 查看: 111| 评论: 0|原作者: 情殇


用单步跟踪Anti-Debugger,Anti-Debugger,反跟踪技术
2008年06月23日 星期一 下午 02:03
在调试器中,拙劣的debugger是用0xcc 来跟踪代码,但od就是用标志位进行单步跟踪,简单的说就是把TF置位,如果我们有自己的单步跟踪代码,od如果同时也跟踪了,就会“无视”我们自己的代码....达到anti的目的

代码如下:

;===============================cut==============================

;Author:Comic.Liu

.386

.model flat,stdcall

option casemap :none



include windows.inc

include user32.inc

includelib user32.lib

include kernel32.inc

includelib kernel32.lib

.const



.data

szT db 'Title',0

szM db 'You Are Passed',0

.code

SEH proc pExcept:DWORD,pFrame:DWORD,pContext:DWORD,pDispatch:DWORD

pushad

assume esi:ptr EXEPTION_RECORD,edi:ptr CONTEXT



mov esi,[pExcept]

mov edi,[pContext]



mov ebx,[edi].regEip

inc ebx

cmp byte ptr[ebx],0

org $-1

popfd

jz fin

or [edi].regFlag,100h

jmp fin1

fin: inc [edi].regEip

fin1: popad

mov eax,ExceptionContinueExecution

ret







SEH endp



start:

assume fs:nothing

push offset SEH

push fs:[0]

mov fs:[0],esp



pushfd

pushfd

or dword ptr[esp],100h

popfd

;进入这一段代码就翘翘了

nop

ret

;=======End============

;不过可以用OD里的F4直接跳过上面那一段,到下面

popfd

invoke MessageBox,NULL,offset szM,offset szT,NULL



pop fs:[0]

add esp,4

invoke ExitProcess,0



end start

;==========================finish===========================

程序在nop处以Single Step事件进入seh

在seh里面,修改eip跳过代码:ret



如果od跟踪,就截断了single step,seh就不会运行了,然后就出错


最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 01:32 , Processed in 0.201744 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部