Skip to content
forked from bbddda/VMTHook

A safe header only easy to use VMT hooking class.

Notifications You must be signed in to change notification settings

kkoling/EasyVMT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 

Repository files navigation

EasyVMT

A safe header only easy to use VMT hooking class.

Example usage:

#include <iostream>

class ExampleClass 
{
public:
    // Starts at 0.
    virtual void ExampleFunction(int a) 
    {
        std::cout << a << std::endl;
    }
};

typedef void(__stdcall* ExampleFunctionFn)(int);
inline ExampleFunctionFn originalExampleFunction = nullptr;

void __stdcall ExampleFunctionHook(int a) 
{
    return originalExampleFunction(9999999);
}

int main() 
{
    ExampleClass* Example = new ExampleClass();

    EasyVMT* VMT1 = new EasyVMT(Example);

    originalExampleFunction = (ExampleFunctionFn)VMT1->GetVirtualFunction(Example, 0);

    VMT1->Hook(ExampleFunctionHook, 0);

    Example->ExampleFunction(1337);

    VMT1->Unhook();

    Example->ExampleFunction(1337);

    system("pause");
}

About

A safe header only easy to use VMT hooking class.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%