Giter Site home page Giter Site logo

igoryunusov / urmem Goto Github PK

View Code? Open in Web Editor NEW

This project forked from katursis/urmem

0.0 2.0 0.0 27 KB

C++11 cross-platform library for working with memory (hooks, patches, pointer's wrapper, signature scanner etc.)

License: MIT License

C++ 99.55% Makefile 0.45%

urmem's Introduction

urmem

C++11 cross-platform library for working with memory (hooks, patches, pointer's wrapper, signature scanner etc.)

Simple example

#include <iostream>
#include "urmem.hpp"

#ifdef _WIN32
#pragma optimize("", off)
#endif

using namespace std;
using m = urmem;

#ifdef _WIN32
_declspec(noinline) int __cdecl sum(int a, int b)
#else
int sum(int a, int b)
#endif
{
	return a + b;
}

enum e_hook
{
	h_sum
};

int main(void)
{
	m::smart_hook<e_hook::h_sum, m::calling_convention::cdeclcall, int(int, int)> hook_sum(m::get_func_addr(&sum));

	hook_sum.attach([&hook_sum](int a, int b)
	{
		return hook_sum.call(a, b) * 2;
	});

	cout << sum(2, 3) << endl; // will print '10'	
}

TODO

  • x64 support
  • More helper functions

urmem's People

Contributors

katursis avatar

Watchers

James Cloos avatar Igor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.