This commit is contained in:
2025-05-29 19:15:52 +08:00
parent 5ce1a399b1
commit ebfc4bf4f4
6 changed files with 131 additions and 249 deletions

View File

@@ -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

View File

@@ -1924,4 +1924,6 @@ _strflt
_tiddata
_BIN_TYPES_
tagBIND_FLAGS_
ImageBaseOffset32
ImageBaseOffset32
wchar_t
WCHAR

View File

@@ -82,4 +82,5 @@ winspool.h
winsvc.h
winuser.h
winver.h
wtypes.h
wtypes.h
dinput.h