libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
peconv::hooking_func_resolver Class Reference

#include <hooks.h>

Inheritance diagram for peconv::hooking_func_resolver:
Inheritance graph
[legend]

Public Member Functions

void add_hook (const std::string &name, FARPROC function)
 
void replace_dll (std::string dll_name, const std::string &new_dll)
 
virtual FARPROC resolve_func (LPCSTR lib_name, LPCSTR func_name)
 

Detailed Description

A functions resolver that can be used for hooking IAT. Allows for defining functions that are supposed to be replaced.

Definition at line 76 of file hooks.h.

Member Function Documentation

◆ add_hook()

void peconv::hooking_func_resolver::add_hook ( const std::string & name,
FARPROC function )
inline

Define a function that will be replaced.

Parameters
name: a name of the function that will be replaced
function: an address of the replacement function

Definition at line 83 of file hooks.h.

◆ replace_dll()

void peconv::hooking_func_resolver::replace_dll ( std::string dll_name,
const std::string & new_dll )
inline

Define a DLL that will be replaced.

Parameters
dll_name: a name of the DLL to be replaced
new_dll: a name of the new DLL that will be loaded instead

Definition at line 93 of file hooks.h.

◆ resolve_func()

FARPROC peconv::hooking_func_resolver::resolve_func ( LPCSTR lib_name,
LPCSTR func_name )
virtual

Get the address (VA) of the function with the given name, from the given DLL. If the function was hooked, it retrieves the address of the replacement function instead.

Parameters
func_name: the name of the function
lib_name: the name of the DLL
Returns
Virtual Address of the exported function, or the address of the replacement function.

Reimplemented from peconv::default_func_resolver.

Definition at line 81 of file hooks.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: