From 7897276f166cf044943d1a878a07965bfeb2c5e0 Mon Sep 17 00:00:00 2001 From: yuv420p10le <139547685+yuv420p10le@users.noreply.github.com> Date: Tue, 28 May 2024 16:36:30 +0300 Subject: [PATCH] Updated Linux signature for PMS 1.40.3.8502-f4f0b17e1. New signature matches both current stable (1.40.2.8395) and current beta (1.40.3.8502-f4f0b17e1) --- linux/hook.cpp | 10 ++++++++-- linux/hook.hpp | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/linux/hook.cpp b/linux/hook.cpp index 0bd0839..f67732b 100644 --- a/linux/hook.cpp +++ b/linux/hook.cpp @@ -98,6 +98,11 @@ uintptr_t sig_scan(const uintptr_t start, const uintptr_t end, std::string_view return 0; } +uintptr_t follow_call_rel32(const uintptr_t address) +{ + return address + 5 + *reinterpret_cast(address + 1); +} + uint64_t hook_is_feature_available([[maybe_unused]] uintptr_t user, [[maybe_unused]] const char* feature) { // `feature` is a GUID. You can use it to enable certain features rather than Godmode (everything); but there's no reason to limit ourselves.. is there? @@ -115,12 +120,13 @@ void hook() return; } - const auto _is_feature_available = sig_scan(dottext_start, dottext_end, "55 48 89 E5 41 57 41 56 53 50 49 89 F7 48 89 FB 4C 8D 77 08 4C 89 F7 E8 ? ? ? ? 48 8D 7B 30"); + const auto _is_feature_available_ref = sig_scan(dottext_start, dottext_end, "E8 ? ? ? ? 86 43"); - if(_is_feature_available == 0) + if(_is_feature_available_ref == 0) { return; } + const auto _is_feature_available = follow_call_rel32(_is_feature_available_ref); write_jmp(_is_feature_available, reinterpret_cast(&hook_is_feature_available)); } diff --git a/linux/hook.hpp b/linux/hook.hpp index 8ac6c81..2e3223d 100644 --- a/linux/hook.hpp +++ b/linux/hook.hpp @@ -6,5 +6,6 @@ bool get_dottext_info(uintptr_t& start, uintptr_t& end); void write_jmp(const uintptr_t from, const uintptr_t to); uintptr_t sig_scan(const uintptr_t start, const uintptr_t end, std::string_view pattern); +uintptr_t follow_call_rel32(const uintptr_t address); uint64_t hook_is_feature_available(uintptr_t user, const char* feature); void hook();