Cracked PMS 1.40.5.8854 (2024/08/13) ahead of time.

This commit is contained in:
yuv420p10le
2024-08-13 22:54:05 +03:00
parent 8f89b436c1
commit d9ec635fbd
6 changed files with 67 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
#include <cstring>
#include <sstream>
#include <unordered_map>
#include <bitset>
#include <unistd.h>
#include <sys/mman.h>
#include "Zydis.h"
@@ -56,6 +57,7 @@ std::unordered_map<std::string, std::string> g_features =
{ "ce8f644e-87ce-4ba5-b165-fadd69778019", "disable_sharing_friendships" },
{ "6225c337-cd26-4ff0-b864-6c6dd84c9e0d", "disco-reported-issues" },
{ "d865f64a-ca06-472d-ae01-7a444aba6251", "disco-director-cast-crew-updates" },
{ "e9cc7ec1-be5a-4727-af7b-0f107af1a07c", "disco-epg-airings-on-detail-pages" },
{ "2131d3dc-56c8-45d0-acec-c4683fd9a027", "discover-genre-browsing" },
{ "cb0e4c75-b1cb-43e9-97ea-6b9bc66c717b", "discover-managed-related-vod" },
{ "807d9881-a846-40c3-8d54-84fc490b7ba9", "discover-managed-user-test" },
@@ -120,6 +122,7 @@ std::unordered_map<std::string, std::string> g_features =
{ "2ea0e464-ea4f-4be2-97c1-ce6ed4b377dd", "photos-metadata-edition" },
{ "850f3d1e-3f38-44c1-9c0c-e3c9127b8b5a", "photosV6-edit" },
{ "3a2b0cb6-1519-4431-98e2-823c248c70eb", "photosV6-tv-albums" },
{ "068f4adf-43e5-4cc6-b5a1-1243e1be4c53", "playback-speed" },
{ "02da2909-ddfd-46be-9e42-65008a79fc05", "played_badges" },
{ "9aea4ca5-2095-4619-9339-88c1e662fde6", "pms_health" },
{ "222020fb-1504-492d-af33-a0b80a49558a", "premium-dashboard" },
@@ -160,6 +163,7 @@ std::unordered_map<std::string, std::string> g_features =
{ "9b5a4bea-3bbe-45d2-b226-00a6ef4d8e65", "tvod" },
{ "5d80b92d-4ecf-4b0b-935f-5efc907bb2c1", "tvod_playback" },
{ "362c5ba7-41e8-400d-8354-18d53868e2d3", "tvod-rentals" },
{ "e25d0e25-109e-4d6d-9a54-db0931af31c3", "tvod-wtw" },
{ "06d14b9e-2af8-4c2b-a4a1-ea9d5c515824", "two-factor-authentication" },
{ "20824f5c-6dd9-4655-9970-e7701a73c02a", "two-factor-authentication-clients" },
{ "d14556be-ae6d-4407-89d0-b83953f4789a", "type-first" },
@@ -173,6 +177,7 @@ std::unordered_map<std::string, std::string> g_features =
{ "1b870b8e-f1a7-497c-80b2-857d45f3123f", "vod-schema" },
{ "65faa2d0-f57e-4c63-a6b6-f1baa48951b1", "watch-together-20200520" },
{ "f83450e2-759a-4de4-8b31-e4a163896d43", "watch-together-invite" },
{ "236de47b-a757-4ed7-9003-507b296057b5", "watched-badges-v3" },
{ "f0c452ce-11e7-465f-be04-5fb0bf4bec48", "watchlist" },
{ "edd6039a-137c-4ace-b5d5-4e111ce9690b", "watchlist-source" },
{ "f0f40559-a43a-4b8f-85ef-bdb1de1a912a", "watchlist-rss" },
@@ -212,8 +217,10 @@ std::unordered_map<std::string, std::string> g_features =
{ "a6f3f9b3-c10c-4b94-ad59-755e30ac6c90", "detect-commercials" },
};
std::bitset<704>* g_feature_flags;
auto _is_feature_available = reinterpret_cast<decltype(&hook_is_feature_available)>(0);
auto _map_find = reinterpret_cast<decltype(&hook_map_find)>(0);
auto _bitset_init = reinterpret_cast<decltype(&hook_bitset_init)>(0);
std::optional<std::tuple<uintptr_t, uintptr_t>> get_dottext_info()
{
@@ -373,6 +380,14 @@ uint64_t* hook_map_find(uintptr_t* rcx, const char** str)
return _map_find(rcx, str);
}
uint64_t hook_bitset_init(uintptr_t rcx)
{
auto ret = _bitset_init(rcx);
g_feature_flags->set();
return ret;
}
void hook()
{
auto info = get_dottext_info();
@@ -385,6 +400,24 @@ void hook()
const auto start = std::get<0>(info.value());
const auto end = std::get<1>(info.value());
// Features are now enabled in boost::atomic<std::bitset> as of 2024/08/13 PMS BETA
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));
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)
{
if(auto trampoline = create_hook(bitset_init.value(), reinterpret_cast<uintptr_t>(hook_bitset_init)); trampoline)
{
_bitset_init = reinterpret_cast<decltype(_bitset_init)>(trampoline.value());
// No reason to hook the rest
return;
}
}
}
if(const auto is_feature_available_ref = sig_scan(start, end, "E8 ? ? ? ? 86 43"); is_feature_available_ref)
{
const auto is_feature_available = follow_call_rel32(is_feature_available_ref.value());

View File

@@ -11,4 +11,5 @@ std::optional<uintptr_t> sig_scan(const uintptr_t start, const uintptr_t end, st
uintptr_t follow_call_rel32(const uintptr_t address);
uint64_t hook_is_feature_available(uintptr_t rcx, const char** guid);
uint64_t* hook_map_find(uintptr_t* rcx, const char** str);
uint64_t hook_bitset_init(uintptr_t rcx);
void hook();