Initial commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
namespace vfunc
|
||||
{
|
||||
template <size_t Index, typename ReturnType, typename... Args>
|
||||
__forceinline ReturnType call(void* instance, Args... args)
|
||||
{
|
||||
using Fn = ReturnType(__thiscall*)(void*, Args...);
|
||||
|
||||
auto function = (*reinterpret_cast<Fn**>(instance))[Index];
|
||||
|
||||
return spoof_call(function, instance, args...);
|
||||
}
|
||||
}
|
||||
|
||||
#define VIRTUAL_FUNC(NAME, RETURN_VALUE, INDEX, ARGS, ...) RETURN_VALUE NAME ARGS { return vfunc::call<INDEX, RETURN_VALUE>(__VA_ARGS__); }
|
||||
Reference in New Issue
Block a user