Page 1 of 1

WithDLL kann meinen Hook nicht in den Zielprozess einfügen

Posted: 18 Jan 2025, 19:19
by Guest
Ich habe mithilfe von Microsoft Detours eine DLL zum Einbinden von Funktionen in einen Zielprozess implementiert. Wenn ich jedoch withdll.exe ausführe, das mit Detours geliefert wird, erhalte ich die folgende Fehlermeldung:

Code: Select all

B:>withdll.exe /d:[...]\IniHook.dll HookTarget.exe
withdll.exe: Error: [...]\IniHook.dll does not export ordinal #1.
See help entry DetourCreateProcessWithDllEx in Detours.chm.
Allerdings kann ich Detours.chm nicht finden, um nachzuschlagen, was zu tun ist.
Was könnte das Problem sein und wie kann man es beheben?
Mein Hook-Code ist

Code: Select all

#include "pch.h"
#define WIN32_LEAN_AND_MEAN
#include 
#include 
#include 

#pragma comment(lib, "detours.lib")

typedef DWORD(WINAPI* GetPrivateProfileStringW_t)(LPCWSTR app, LPCWSTR key, LPCWSTR def, LPWSTR result, DWORD size, LPCWSTR file_name);

GetPrivateProfileStringW_t TrueGetPrivateProfileStringW = nullptr;

DWORD WINAPI HookedGetPrivateProfileStringW(LPCWSTR app, LPCWSTR key, LPCWSTR def, LPWSTR result, DWORD size, LPCWSTR file_name)
{
std::wcout