NVDA Helper
In-process and lite high-speed utilities for NVDA
dllImportTableHooks.h File Reference
#include <string>
#include <set>
#include <map>
#include <windows.h>

Go to the source code of this file.

Classes

class  DllImportTableHooks
 

Typedefs

typedef std::map< void *, void * > funcToFunc_t
 
typedef std::map< std::string, funcToFunc_tmoduleNameToFuncToFunc_t
 
typedef std::map< void *, IMAGE_THUNK_DATA * > funcToThunk_t
 

Functions

voiddllImportTableHooks_hookSingle (char *targetDll, char *importDll, char *functionName, void *newFunction)
 Hooks a single imported function in a dll.
 
void dllImportTableHooks_unhookSingle (void *hook)
 Unhooks a previously hooked function hooked by dllImportTableHooks_hookSingle.
 

Typedef Documentation

◆ funcToFunc_t

typedef std::map<void*,void*> funcToFunc_t

◆ moduleNameToFuncToFunc_t

typedef std::map<std::string,funcToFunc_t> moduleNameToFuncToFunc_t

◆ funcToThunk_t

typedef std::map<void*,IMAGE_THUNK_DATA*> funcToThunk_t

Function Documentation

◆ dllImportTableHooks_hookSingle()

void * dllImportTableHooks_hookSingle ( char * targetDll,
char * importDll,
char * functionName,
void * newFunction )

Hooks a single imported function in a dll.

Uses the DllImportTableHook class.

Parameters
targetDllthe name of the dll who has imported the function to be hooked.
importDllthe name of the dll containing the function imported.
functionNameThe name of the function to be hooked.
newFunctionthe function to be called instead.
Returns
an opaque pointer to the DllImportTableHook class instance that hooked the function.

References DllImportTableHooks::hookFunctions(), and DllImportTableHooks::requestFunctionHook().

◆ dllImportTableHooks_unhookSingle()

void dllImportTableHooks_unhookSingle ( void * hook)

Unhooks a previously hooked function hooked by dllImportTableHooks_hookSingle.

Parameters
hookThe opaque pointer returned from a ccessful call to dllImportTableHooks_hookSingle.

References DllImportTableHooks::targetModule, and DllImportTableHooks::unhookFunctions().