WithDLL kann meinen Hook nicht in den Zielprozess einfügen

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: WithDLL kann meinen Hook nicht in den Zielprozess einfügen

by Guest » 18 Jan 2025, 19:19

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

Top