From 48a8c3d00aff07dc7f4b47715d7fcd3d5ddd8545 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 20 Jan 2022 14:42:08 +0100 Subject: [PATCH] feat(Util/System): Get rel address of pointer --- BigBaseV2/src/util/system.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BigBaseV2/src/util/system.hpp b/BigBaseV2/src/util/system.hpp index 621a8c46..bae6642d 100644 --- a/BigBaseV2/src/util/system.hpp +++ b/BigBaseV2/src/util/system.hpp @@ -25,6 +25,13 @@ namespace big::system file.close(); } + inline uintptr_t get_relative_address(void* ptr) + { + uintptr_t base_address = memory::module(nullptr).begin().as(); + + return (uintptr_t)ptr - base_address; + } + inline void patch_blame(bool toggle) { *(unsigned short*)g_pointers->m_blame_explode = toggle ? 0xE990 : 0x850F;