libPeConv
A library to load, manipulate, dump PE files.
Loading...
Searching...
No Matches
peconv::PatchBackup Class Reference

#include <hooks.h>

Public Member Functions

 PatchBackup ()
 
 ~PatchBackup ()
 
void deleteBackup ()
 
bool makeBackup (BYTE *patch_ptr, size_t patch_size)
 
bool applyBackup ()
 
bool isBackup ()
 

Protected Attributes

BYTE * buffer
 
size_t bufferSize
 
BYTE * sourcePtr
 

Detailed Description

A buffer storing a binary patch, that can be applied on a module. Used as a restorable backup in case of function patching.

Definition at line 21 of file hooks.h.

Constructor & Destructor Documentation

◆ PatchBackup()

peconv::PatchBackup::PatchBackup ( )
inline

Creates an empty backup.

Definition at line 26 of file hooks.h.

◆ ~PatchBackup()

peconv::PatchBackup::~PatchBackup ( )
inline

Definition at line 31 of file hooks.h.

Here is the call graph for this function:

Member Function Documentation

◆ applyBackup()

bool PatchBackup::applyBackup ( )

Applies the backup back to the pointer from which it was read.

Definition at line 64 of file hooks.cpp.

Here is the call graph for this function:

◆ deleteBackup()

void peconv::PatchBackup::deleteBackup ( )
inline

Destroys the backup and resets internal fields.

Definition at line 38 of file hooks.h.

◆ isBackup()

bool peconv::PatchBackup::isBackup ( )
inline

Checks if the buffer was filled.

Definition at line 60 of file hooks.h.

◆ makeBackup()

bool PatchBackup::makeBackup ( BYTE * patch_ptr,
size_t patch_size )

Reads bytes from the binary to the backup. The source buffer must be within the current process.

Definition at line 50 of file hooks.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ buffer

BYTE* peconv::PatchBackup::buffer
protected

Definition at line 66 of file hooks.h.

◆ bufferSize

size_t peconv::PatchBackup::bufferSize
protected

Definition at line 67 of file hooks.h.

◆ sourcePtr

BYTE* peconv::PatchBackup::sourcePtr
protected

Definition at line 69 of file hooks.h.


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