summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-11-09 16:17:54 +0100
committerFilip Gawin <filip.gawin@zoho.com>2019-11-12 23:34:28 +0100
commitbe7d1d1a6327426dbe24c5b7b8eb16e5bb83a587 (patch)
tree3f802ec81aa739a423db3946f70244bfca0c536f /src/core/re3.cpp
parentfixes (diff)
downloadre3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar.gz
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar.bz2
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar.lz
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar.xz
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.tar.zst
re3-be7d1d1a6327426dbe24c5b7b8eb16e5bb83a587.zip
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index d6bc8148..ab099726 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -29,12 +29,10 @@ void **rwengine = *(void***)0x5A10E1;
DebugMenuAPI gDebugMenuAPI;
-WRAPPER void *gtanew(uint32 sz) { EAXJMP(0x5A0690); }
-WRAPPER void gtadelete(void *p) { EAXJMP(0x5A07E0); }
-
-// overload our own new/delete with GTA's functions
-void *operator new(size_t sz) { return gtanew(sz); }
-void operator delete(void *ptr) noexcept { gtadelete(ptr); }
+STARTPATCHES
+ InjectHook(0x5A07E0, (void (*)(void*)) &operator delete, PATCH_JUMP);
+ InjectHook(0x5A0690, (void* (*)(size_t)) &operator new, PATCH_JUMP);
+ENDPATCHES
#ifdef USE_PS2_RAND
unsigned __int64 myrand_seed = 1;