Cleanup
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef BD364AE6_AD96_4DEA_9D6B_B237BC1E2C6A
|
||||
#define BD364AE6_AD96_4DEA_9D6B_B237BC1E2C6A
|
||||
|
||||
#include <cstdint>
|
||||
#include <gh_datasegment.h>
|
||||
|
||||
template <size_t addr> inline constexpr void checkMappedMemory() {
|
||||
@@ -8,8 +9,9 @@ template <size_t addr> inline constexpr void checkMappedMemory() {
|
||||
static_assert(addr < GH_DATA_END, "Address outside upper bound");
|
||||
}
|
||||
|
||||
uint8_t *gh_map_dbg_mem(size_t addr);
|
||||
void gh_init_dbg_loader();
|
||||
|
||||
#define GH_MEM(addr) (checkMappedMemory<addr>(), *memoryMapSafe(addr))
|
||||
#define GH_MEM(addr) (checkMappedMemory<addr>(), *gh_map_dbg_mem(addr))
|
||||
|
||||
#endif /* BD364AE6_AD96_4DEA_9D6B_B237BC1E2C6A */
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
#define EDBE48FC_B879_4985_9274_B7ACF24AD024
|
||||
|
||||
#include "base.h"
|
||||
|
||||
#if RE_DBG_INJECTED
|
||||
#include "dbg_mem.h"
|
||||
#else
|
||||
#include "static_mem.h"
|
||||
#endif
|
||||
|
||||
#include <gh_types.h>
|
||||
|
||||
#endif /* EDBE48FC_B879_4985_9274_B7ACF24AD024 */
|
||||
|
||||
@@ -13,7 +13,7 @@ template <typename T, typename... Args>
|
||||
T gh_stub_impl_cdecl(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __cdecl T (*)(Args...);
|
||||
static Callable *fn = (Callable *)gh_stub_impl_ptr(ptr_);
|
||||
static Callable fn = (Callable)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
@@ -24,7 +24,7 @@ template <typename T, typename... Args>
|
||||
T gh_stub_impl_stdcall(void *ptr_, Args... args) {
|
||||
#if RE_DBG_INJECTED
|
||||
using Callable = __stdcall T (*)(Args...);
|
||||
static Callable *fn = (Callable *)gh_stub_impl_ptr(ptr_);
|
||||
static Callable fn = (Callable)gh_stub_impl_ptr(ptr_);
|
||||
return fn(args...);
|
||||
#else
|
||||
throw GHStubException("Function not implemented");
|
||||
|
||||
Reference in New Issue
Block a user