WIP
This commit is contained in:
@@ -10,22 +10,22 @@ struct GHStubException : public std::exception {
|
||||
void *gh_stub_impl_ptr(void *ptr);
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T gh_stub_impl_cdecl(void *ptr, Args... args) {
|
||||
T gh_stub_impl_cdecl(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __cdecl T (*)(Args...);
|
||||
static Callable *ptr = (Callable *)gh_stub_impl_ptr(ptr);
|
||||
return ptr(args...);
|
||||
static Callable *fn = (Callable *)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
T gh_stub_impl_stdcall(void *ptr, Args... args) {
|
||||
T gh_stub_impl_stdcall(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __stdcall T (*)(Args...);
|
||||
static Callable *ptr = (Callable *)gh_stub_impl_ptr(ptr);
|
||||
return ptr(args...);
|
||||
static Callable *fn = (Callable *)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user