使用 GetStartupInfo 检查自己是否被"调试"
2014-04-16 09:17
489 查看
标 题: 使用 GetStartupInfo 检查自己是否被"调试"
作 者: dummy
时 间: 2006-09-03,17:42:24
链 接: http://bbs.pediy.com/showthread.php?t=31447
在使用 CreateProcess 创建进程时,需要传递
STARTUPINFO 的结构的指针,
而常常我们并不会一个一个设置其结构的值,
连把其他不用的值清0都会忽略,
而 ollydbg 也这样做了,
我们可以使用 GetStartupInfo 检查启动信息,
如果很多值为"不可理解"的,那么就说明自己不是由 explorer 来创建的.(explorer.exe 使用 shell32 中 ShellExecute 的来运行程序, ShellExecute 会清不用的值)
还有一点 ollydbg 会向 STARTUPINFO 中的 dwFlags 设置 STARTF_FORCEOFFFEEDBACK,而 explorer 不会
////////////////////////
//ex
#include <windows.h>
#include <stdio.h>
#pragma comment(linker, "/subsystem:windows /entry:main")
int main()
{
STARTUPINFO si;
GetStartupInfo(&si);
if (
(si.dwX != 0) ||
(si.dwY != 0) ||
(si.dwXCountChars != 0) ||
(si.dwYCountChars != 0) ||
(si.dwFillAttribute != 0) ||
(si.dwXSize != 0) ||
(si.dwYSize != 0) ||
(si.dwFlags & STARTF_FORCEOFFFEEDBACK)
)
{
MessageBox(NULL, "found debugger!", NULL, 0);
}
else
{
MessageBox(NULL, "no found debugger!", NULL, 0);
}
return 0;
}
作 者: dummy
时 间: 2006-09-03,17:42:24
链 接: http://bbs.pediy.com/showthread.php?t=31447
在使用 CreateProcess 创建进程时,需要传递
STARTUPINFO 的结构的指针,
而常常我们并不会一个一个设置其结构的值,
连把其他不用的值清0都会忽略,
而 ollydbg 也这样做了,
我们可以使用 GetStartupInfo 检查启动信息,
如果很多值为"不可理解"的,那么就说明自己不是由 explorer 来创建的.(explorer.exe 使用 shell32 中 ShellExecute 的来运行程序, ShellExecute 会清不用的值)
还有一点 ollydbg 会向 STARTUPINFO 中的 dwFlags 设置 STARTF_FORCEOFFFEEDBACK,而 explorer 不会
////////////////////////
//ex
#include <windows.h>
#include <stdio.h>
#pragma comment(linker, "/subsystem:windows /entry:main")
int main()
{
STARTUPINFO si;
GetStartupInfo(&si);
if (
(si.dwX != 0) ||
(si.dwY != 0) ||
(si.dwXCountChars != 0) ||
(si.dwYCountChars != 0) ||
(si.dwFillAttribute != 0) ||
(si.dwXSize != 0) ||
(si.dwYSize != 0) ||
(si.dwFlags & STARTF_FORCEOFFFEEDBACK)
)
{
MessageBox(NULL, "found debugger!", NULL, 0);
}
else
{
MessageBox(NULL, "no found debugger!", NULL, 0);
}
return 0;
}
相关文章推荐
- 使用 GetStartupInfo 检查自己是否被"调试"
- 使用 GetStartupInfo 检查自己是否被"调试"
- 使用 GetStartupInfo 检查自己是否被"调试"
- 看使用 GetStartupInfo 检查自己是否被"调试"
- 使用 GetStartupInfo 检查自己是否被"调试"
- 使用 GetStartupInfo 检查自己是否被"调试"
- 使用 GetStartupInfo 检查自己是否被"调试"(转自看雪论坛)
- GetStartupInfo检测程序处于被调试状态
- GetStartupInfo检测程序处于被调试状态
- IE8"开发人员工具"使用详解下(浏览器模式、文本模式、JavaScript调试、探查器)
- 使用命令行创建Android工程报错:"Target id is not valid. Use 'android.bat list targets' to get the target ids"
- Windows API 之 GetStartupInfo 、CreateProcess
- GetStartupInfo 函数
- IE8"开发人员工具"使用详解下(浏览器模式、文本模式、JavaScript调试、探查器)
- file_get_contents("php://input")的使用方法
- Android中的"Unable to start activity ComponentInfo"或者"Unable to instantiate activity ComponentInfo"的错误
- PL/SQL dev工具 使用for update-->Edit Date 时出错"These query results are not updateable,Include the ROWID to get updateable results."
- 使用class.getClassLoader().getResource("")的注意事项
- 解决当字段不存在使用resultSet.getString("id")报异常的问题
- [转] "计算机无法访问,您可能没有权限使用网络资源.请与这台服务器的管理员联系以查明您是否有访问权限" 解决方法