zoukankan      html  css  js  c++  java
  • 反调试功能<IsDebuggerPresent>

    依赖于API的反调试

    这个函数会看PEB中的BeingDebugged是否为0,不为0就表示无调试器,否则表示有调试器.注意的是以前代码都会对这个函数首字节是否为0x64作判断,但在win7下,需要对应kernelBase中的IsDebuggerPresent,而不是kernel32中的IsDebuggerPresent

    //使用IsDebuggerPresent函数检测
    DbgToolType AntiDebugged::AD_IsDebuggerPresent()
    {
    	HMODULE hKernelBaseDll = ::LoadLibrary(TEXT("kernelBase.dll"));
    	if (NULL != hKernelBaseDll)
    	{
    		// 不要使用kernel32,kernel32中IsDebuggerPresent第一条指令并非0x64
    		FARPROC pIsDebuggerPresent = ::GetProcAddress(hKernelBaseDll, "IsDebuggerPresent");
    		if (!pIsDebuggerPresent)
    		{
    			::FreeLibrary(hKernelBaseDll);
    			return DGBTOOL_NO;
    		}
    
    
    		if ((*(BYTE *)pIsDebuggerPresent == 0xCC)
    			||(*(BYTE *)pIsDebuggerPresent != 0x64)
    			|| pIsDebuggerPresent()
    			)
    		{
    			::FreeLibrary(hKernelBaseDll);
    			return DBGTOOL_CUSTOM;
    		}
    		else
    		{
    			::FreeLibrary(hKernelBaseDll);
    			return DGBTOOL_NO;
    		}
    
    	}
    
    	return DGBTOOL_NO;
    }


    这个过掉的方式比较简单:只需要把PEB中的BeingDebugged置为0.

    比如直接在OD命令中输入:d fs:[30]+2把它改为1即可过掉:

  • 相关阅读:
    安装VMware Tools和设置屏幕
    线程
    制作数据集-解析篇
    制作数据集-应用篇
    tf.train.examle函数
    输入手写数字输出识别结果——分析篇
    输入手写数字输出识别结果
    断点续训
    UC972开发板,参考实验8,完成定时器触发信号输出实验
    hz和s和脉冲
  • 原文地址:https://www.cnblogs.com/hgy413/p/3693454.html
Copyright © 2011-2022 走看看