首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Detours中未解决的外部符号?(绕行:x64::DetourFunction,Direct3DCreate9)

Detours中未解决的外部符号?(绕行:x64::DetourFunction,Direct3DCreate9)
EN

Stack Overflow用户
提问于 2022-01-04 14:41:09
回答 1查看 245关注 0票数 0

因此,我遵循一个关于yt的dll注入教程,在编译时给了我一些错误。

1.未解决的外部符号“未签名的(?DetourFunction@X64@Detours@@YA_K_K0W4X64Option@2@@Z) __int64 __cdecl Detours::x64::DetourFunction(未签名的__int64,无符号的__int64,enum::X64Option)”“函数中引用的__int64”未签名的long __cdecl mainThread(void *)

代码语言:javascript
复制
 CODE TO ERROR:


  DWORD WINAPI mainThread(PVOID base) {
void* d3d9Device[119];

if(GetD3D9Device(d3d9Device, sizeof(d3d9Device))){
    oEndScene = (EndScene)Detours::X64::DetourFunction((uintptr_t)d3d9Device[42], (uintptr_t)hkEndScene);//here
}

while (true) {
    if (GetAsyncKeyState(VK_F10)) {
        CleanUpDeviceD3D();
        FreeLibraryAndExitThread(static_cast<HMODULE>(base),1);
    }
}

FreeLibraryAndExitThread(static_cast<HMODULE>(base), 1);

} 2.函数"bool __cdecl GetD3D9Device(void * *,无符号__int64)“中引用的未解析外部符号__int64

代码语言:javascript
复制
CODE TO ERROR:


bool GetD3D9Device(void **pTable, size_t size) {
if (!pTable) {
    return false;
}

g_pD3D = Direct3DCreate9(D3D_SDK_VERSION); //here

对于第一个错误,本教程说明您应该使用以下语法:

oEndScene = (EndScene)Detours::X64::DetourFunction((Detours::uint8_t*)d3d9Device[42], (Detours::uint8_t*)hkEndScene);

然而,为我的绕道没有uint8_t和一些论坛上说使用uintptr_t,但我仍然得到错误。我试着查看了我的includes和release,但它仍然表示即使包含了Detoursx64.cpp所在的文件夹,也没有解决外部符号的问题。

任何帮助我们都很感激。

EN

回答 1

Stack Overflow用户

发布于 2022-05-24 18:30:05

您需要将Detours编译为x86,并使用发布文件夹,而不是将其编译为x64

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70580504

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档