C++11 cross-platform library for working with memory (hooks, patches, pointer's wrapper, signature scanner etc.)
#include<iostream>
#include"urmem.hpp"
#ifdef _WIN32
#pragma optimize("", off)
#endif
#ifdef _WIN32
_declspec(noinline)
#endifint
#ifdef _WIN32
__cdecl
#endifSum(int a, int b) {
return a + b;
}
urmem::hook hook_sum;
intMySum(int a, int b) {
return hook_sum.call<urmem::calling_convention::cdeclcall, int>(a, b) * 2;
}
intmain() {
hook_sum.install(urmem::get_func_addr(&Sum), urmem::get_func_addr(&MySum));
std::cout << Sum(2, 3) << std::endl; // will print '10'return1;
}- x64 support
- More helper functions