【问题标题】:Detour Identifier not found未找到绕行标识符
【发布时间】:2012-12-01 11:29:58
【问题描述】:

我收到了错误

error C3861: 'DetourTransactionBegin': identifier not found
error C3861: 'DetourUpdateThread': identifier not found
error C3861: 'DetourAttach': identifier not found
error C3861: 'DetourAttach': identifier not found
error C3861: 'DetourAttach': identifier not found
error C3861: 'DetourAttach': identifier not found
error C3861: 'DetourTransactionCommit': identifier not found
error C3861: 'DetourTransactionBegin': identifier not found
error C3861: 'DetourUpdateThread': identifier not found
error C3861: 'DetourDetach': identifier not found
error C3861: 'DetourDetach': identifier not found
error C3861: 'DetourDetach': identifier not found
error C3861: 'DetourDetach': identifier not found
error C3861: 'DetourTransactionCommit': identifier not found

有错误的代码:

DetourTransactionBegin();
DetourUpdateThread( GetCurrentThread() );
DetourAttach( &(PVOID &)Real_Send, Mine_Send );
DetourAttach( &(PVOID &)Real_Recv, Mine_Recv );
DetourAttach( &(PVOID &)Real_RecvFrom, Mine_RecvFrom );
DetourAttach( &(PVOID &)Real_WSARecvEx, Mine_WSARecvEx );
DetourTransactionCommit();

我的完整头文件:

#pragma once

#include "targetver.h"

#include <cstdio>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <string>
#include <windows.h>
#include <detours.h>

#pragma comment( lib, "Ws2_32.lib" )
#pragma comment( lib, "detours.lib" )
#pragma comment( lib, "detoured.lib" )
#pragma comment( lib, "Mswsock.lib" )

我就是找不到问题。
我在链接器选项的附加包含中添加了 detours.lib 的目录。

使用 detours 1.5


更新

所以我尝试将 detours 文件本地添加到项目中。

#include "detours.h"

还是同样的错误。

【问题讨论】:

    标签: c++ dll detours


    【解决方案1】:

    这些函数在 detours 2.1 API 中。

    【讨论】:

    • 最后一个问题,致命错误 LNK1104: cannot open file 'detoured.lib' ?
    • 看起来是调试版的库。
    • 我猜当你构建调试配置时它需要 detoured.lib。 'd' 基本上意味着它是库的调试版本。但这只是猜测。如果您在发布配置中构建项目,您可能想检查会发生什么。
    猜你喜欢
    • 2016-07-25
    • 2014-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多