【发布时间】:2013-04-15 11:03:59
【问题描述】:
我的编译器:Microsoft Visual Studio 2012。
我的代码在 detours 2.1 上可以正常工作,但我不能再用我的编译器编译它(模块对 SAFESEH 图像不安全。)。我需要使用像 MVS2005 这样的旧编译器,但我不想这样做。
所以我需要更新我的代码并使用 detours 3.0。
编辑了一些东西,得到了 4 个错误。
error C3861: 'DetourFunction': identifier not found
error C3861: 'DetourFunction': identifier not found
error C3861: 'DetourRemove': identifier not found
error C3861: 'DetourRemove': identifier not found
这是代码块:
此处出现DetourFunction错误
o_NtQuerySystemInformation = (t_NtQuerySystemInformation)DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtQuerySystemInformation"), (PBYTE)My_NtQuerySystemInformation);
o_ZwOpenProcess = (t_ZwOpenProcess)DetourFunction((PBYTE)GetProcAddress(GetModuleHandle("ntdll.dll"), "ZwOpenProcess"), (PBYTE)My_ZwOpenProcess);
DetourRemove 此处的错误
DetourRemove((PBYTE)o_NtQuerySystemInformation, (PBYTE)My_NtQuerySystemInformation);
DetourRemove((PBYTE)o_ZwOpenProcess, (PBYTE)My_ZwOpenProcess);
更新
所以我尝试将其更改为 DetourAttach 和 DetourDetach,但我收到 PBYTE to PVOID 错误。
【问题讨论】:
-
你从哪里得到这个错误?显示代码。
-
这是完整的代码:pastebin.com/XtfSHxBL
-
嘿,任何人点击这个页面我可能有同样的 pbyte/pvoid 错误,可能看这里:[link]stackoverflow.com/questions/21591698/…