因此,我遵循一个关于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 *)
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
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所在的文件夹,也没有解决外部符号的问题。
任何帮助我们都很感激。
发布于 2022-05-24 18:30:05
您需要将Detours编译为x86,并使用发布文件夹,而不是将其编译为x64
https://stackoverflow.com/questions/70580504
复制相似问题