summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZephiles <cae222@yahoo.com>2021-04-25 20:02:40 -0500
committerZephiles <cae222@yahoo.com>2021-04-25 20:02:40 -0500
commit5871320e59b26dce936a759a0c8389eb5507933d (patch)
treeb860fb3fef125a140ffaba402f2aa5d999e69d06
parent09319a8b90032bd7cad04d45ae7885b4565b48e1 (diff)
unhookFunction - Make sure the trampoline isn't a nullptrHEADmaster
-rw-r--r--include/patch.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/patch.h b/include/patch.h
index e67447d..e9e14f5 100644
--- a/include/patch.h
+++ b/include/patch.h
@@ -40,6 +40,11 @@ namespace libtp::patch
template<typename Func>
Func unhookFunction( Func trampoline )
{
+ if ( !trampoline )
+ {
+ return nullptr;
+ }
+
uint32_t* instructions = reinterpret_cast<uint32_t*>( trampoline );
// Restore the original instruction