feat(Util/System): Get rel address of pointer

This commit is contained in:
Yimura 2022-01-20 14:42:08 +01:00
parent c922f4d498
commit 48a8c3d00a
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682

View File

@ -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<uintptr_t>();
return (uintptr_t)ptr - base_address;
}
inline void patch_blame(bool toggle)
{
*(unsigned short*)g_pointers->m_blame_explode = toggle ? 0xE990 : 0x850F;