【问题标题】:PoC Anti-Debugging technique causes program to terminate?PoC反调试技术导致程序终止?
【发布时间】:2014-06-19 05:44:07
【问题描述】:

我正在自学分析恶意软件,为了增加对一些更常见的反调试技术的理解,我在汇编中编写了int 2d 调试器检测概念。然而,当它到达int 2d 时,程序终止而不是跳过预期的操作码。 这是我的代码:

include 'win32ax.inc'

.data
dbg db "Debugger!",0
nodbg db "No debugger!",0

.code
start:
xor eax,eax    ;set the zero flag
int 2dh        ;The debugger detection interupt

inc eax        ;the instruction to be skipped during debugging
jnz notpresent ;the jump

invoke MessageBox,0,dbg,dbg,MB_OK ;Debugger detected!
jmp exit

notpresent:
invoke MessageBox,0,nodbg,nodbg,MB_OK ;No debugger detected!

exit:
invoke ExitProcess,0
.end start

它应该做的是跳转到 MessageBox 说“没有调试器!”,相反,当它到达int 2d 操作码时,即使没有被调试,程序也会崩溃。有什么有用的提示吗?我做错了什么,我该如何解决?如果有帮助,我正在使用 The Flat Assembler。

【问题讨论】:

    标签: assembly x86 fasm


    【解决方案1】:

    如果没有附加调试器,INT 2Dh 将抛出异常。所以你需要处理这个异常,否则你的程序会崩溃。

    您尝试了哪个调试器,因为其中许多似乎无法正确处理此操作码,并且可能会崩溃或显示意外行为。

    可以在此处找到代码示例和更多信息:OpenRCE Debugger Detection

    【讨论】:

    • 好吧,看来是时候了解如何处理汇编中的异常了,谢谢!
    猜你喜欢
    • 2019-07-04
    • 2019-08-06
    • 1970-01-01
    • 1970-01-01
    • 2014-08-11
    • 2023-03-26
    • 1970-01-01
    • 2019-11-28
    • 1970-01-01
    相关资源
    最近更新 更多