2021-09-18 17:28:15 -04:00
|
|
|
#ifndef UTIL_H
|
|
|
|
#define UTIL_H
|
|
|
|
|
|
|
|
#include <WINDOWS.H>
|
|
|
|
|
|
|
|
BOOL WriteMemory(LPVOID destination, LPVOID source, size_t length, LPVOID oldData = NULL);
|
|
|
|
|
2023-01-05 13:53:02 -05:00
|
|
|
LPVOID OverwriteCall(LPVOID destination, LPVOID localCall);
|
2021-09-18 17:28:15 -04:00
|
|
|
|
2023-01-11 19:35:01 -05:00
|
|
|
int OverwriteAllCalls(LPVOID imageBase, LPCVOID from, LPCVOID to);
|
|
|
|
|
2021-11-29 12:30:50 -05:00
|
|
|
LPVOID SearchPattern(LPVOID imageBase, LPCVOID search, SIZE_T count);
|
|
|
|
|
2021-09-18 17:28:15 -04:00
|
|
|
SIZE_T SearchReplacePattern(LPVOID imageBase, LPCVOID search, LPCVOID replace, SIZE_T count, BOOL only_once = FALSE);
|
|
|
|
|
|
|
|
LPVOID OverwriteImport(LPVOID imageBase, LPCSTR overrideFunction, LPVOID override);
|
|
|
|
|
2023-01-11 19:10:10 -05:00
|
|
|
template <typename T>
|
|
|
|
T PointerToMemberFunction(LPVOID ptr)
|
|
|
|
{
|
|
|
|
union U {
|
|
|
|
LPVOID in;
|
|
|
|
T out;
|
|
|
|
};
|
|
|
|
|
|
|
|
U u;
|
|
|
|
u.in = ptr;
|
|
|
|
return u.out;
|
|
|
|
}
|
|
|
|
|
2021-09-18 17:28:15 -04:00
|
|
|
LPVOID OverwriteVirtualTable(LPVOID object, SIZE_T methodIndex, LPVOID overrideFunction);
|
|
|
|
|
|
|
|
#endif // UTIL_H
|