INT 2DH中断

来源:互联网 发布:深度卷积网络怎么用 编辑:程序博客网 时间:2024/05/18 16:38

立春好时节……Mark一个2dh中断。

;       push    offset _seh     ;;       push    fs:[0]          ; > 设置seh;       mov     fs:[0], esp     ;/;;       int     2dh             ; 如果被调试则正常运行;                               ; 否则异常;       nop;       pop     fs:[0]          ;\ 清楚seh;       add     esp, 4          ;/;;       ...;       debugger detected         检查到调试器时运行;       ...;;       _seh:;       debugger not detected   未检查到调试器时运行


第2dh号中断处理函数是KiDebugService,执行Int 2dh指令时,进程如果没有处于被调试状态,将会抛出异常,如果在被调试状态则能够正常执行。我们可以利用这一点检测调试器的存在; Besides this, int 2Dh can also be used as code obfuscation method.; With attached debugger, after executing int 2Dh, system skips one byte; after int 2Dh:;;       int      2dh;        nop                      ; never executed;        ...