Fixed off by 1 bug causing some features like HDR tone mapping to not work.

This commit is contained in:
yuv420p10le 2024-08-26 21:59:14 +03:00
parent 7d5a79c019
commit 36046155d1
4 changed files with 3 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -404,7 +404,7 @@ void hook()
if(const auto bitset = sig_scan(start, end, "48 8D 0D ? ? ? ? 48 8B 94 05 90 FE FF FF"); bitset)
{
const uintptr_t addr = bitset.value() + 7 + *reinterpret_cast<uint32_t*>(bitset.value() + 3);
g_feature_flags = reinterpret_cast<std::bitset<704>*>(addr + sizeof(uintptr_t));
g_feature_flags = reinterpret_cast<std::bitset<704>*>(addr);
if(const auto bitset_init = sig_scan(start, end, "55 48 89 E5 41 57 41 56 41 55 41 54 53 48 81 EC ? ? 00 00 49 89 FE 48 8D 9D ? ? ? ? 48 89 DF E8 ? ? ? ? 48 8B 1B 48 85 DB"); bitset_init)
{

View File

@ -409,7 +409,7 @@ void hook_bitset_init(uintptr_t rcx, uintptr_t rdx)
g_feature_flags->set();
#if _DEBUG
std::println("[INFO] [plexmediaserver_crack] Forced feature flags on.", reinterpret_cast<uintptr_t>(g_feature_flags));
std::println("[INFO] [plexmediaserver_crack] Forced feature flags on {:08X}.", reinterpret_cast<uintptr_t>(g_feature_flags));
#endif
}
@ -444,7 +444,7 @@ void hook()
// Features are now enabled in std::atomic<std::bitset> as of 2024/08/13 PMS BETA
if(bitset && bitset_init)
{
const uintptr_t addr = bitset.value() + 6 + *reinterpret_cast<uint32_t*>(bitset.value() + 9);
const uintptr_t addr = bitset.value() + 5 + *reinterpret_cast<uint32_t*>(bitset.value() + 9);
g_feature_flags = reinterpret_cast<std::bitset<416>*>(addr + sizeof(uintptr_t));
_bitset_init = safetyhook::create_inline(reinterpret_cast<void*>(bitset_init.value()), reinterpret_cast<void*>(hook_bitset_init));