我一直在阅读Hoglund的其中一本书,尽管我的阅读很棒,但是我可以让它工作吗?他们为什么在书中提供非工作例子?调试循环C++未定义变量,什么类型? Hoglund
#include "stdafx.h"
#include <cstdio>
#include <windows.h>
#include <winbase.h>
#include <tlhelp32.h>
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hProcess;
DEBUG_EVENT dbg_evt;
int aPID;
if(argc != 2)
{
printf("wrong number of params\nusage %s<pid>\n", argv[0]);
return 0;
}
//load the ptr to fDebugSetProcessKillOnExit
fDebugSetProcessKillOnExit = (DEBUGSETPROCESSKILLONEXIT)
GetProcAddress(GetModuleHandle("kernel32.dll"),
"DebugSetProcessKillOnExit");
if(!fDebugSetProcessKillOnExit)
{
printf("[!] failed to get fDebugSetProcessKillOnExit function!\n");
}
aPID = atoi(argv[1]);
}
我得到两个错误消息:
fDebugSetProcessKillOnExit is an undeclared identifier
它应该是什么类型?"Error 4 error C2664: 'GetModuleHandleW' : cannot convert parameter 1 from 'const char [13]' to 'LPCWSTR'
fDebug...
应该是什么类型?为什么aPid = atoi...
系列不工作?
该项目应该用C语言而不是C++语言编译,因为这与本书完全相同?
感谢,R.
。 – 2010-02-16 23:26:26
你有没有检查勘误的例子? – osgx 2010-02-16 23:26:41
克里斯,这是有趣的:) osgx,我没有,但似乎没有要任何,我累了,我可能错过了他们... – flavour404 2010-02-17 01:56:40