Initial commit

This commit is contained in:
Attila Body 2024-04-08 15:40:31 +02:00
commit 8ae1c4e9eb
No known key found for this signature in database
GPG key ID: 3D2FC6085E166F70
5 changed files with 218 additions and 0 deletions

33
src/hooking_test.cpp Normal file
View file

@ -0,0 +1,33 @@
//============================================================================
// Name : hooking_test.cpp
// Author :Attila Body
//============================================================================
#include <stdint.h>
#include <iostream>
using namespace std;
class C
{
public:
void foo(int bar)
{
cout << reinterpret_cast<uintptr_t>(this) << " -> " << bar << endl;
}
};
typedef void (C::*cvifptr_t)(int);
typedef void (*vifptr_t)(int, int);
int main(int argc, char **argv)
{
C c;
cvifptr_t zup = &C::foo;
cout << zup << endl;
vifptr_t baz = reinterpret_cast<vifptr_t>(zup);
cout << baz << endl;
(c.*zup)(123);
(*baz)(1234, 321);
return 0;
}