From eddbd7c072c3b94aca918049fdf45f67054ab5b4 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 4 Mar 2019 22:17:18 -0800 Subject: [PATCH] dmnt-cheat: output value on EnableFrozenAddress --- stratosphere/dmnt/source/dmnt_cheat_manager.cpp | 3 ++- stratosphere/dmnt/source/dmnt_cheat_manager.hpp | 2 +- stratosphere/dmnt/source/dmnt_cheat_service.cpp | 4 ++-- stratosphere/dmnt/source/dmnt_cheat_service.hpp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stratosphere/dmnt/source/dmnt_cheat_manager.cpp b/stratosphere/dmnt/source/dmnt_cheat_manager.cpp index 274fc973d..98d8453ad 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_manager.cpp +++ b/stratosphere/dmnt/source/dmnt_cheat_manager.cpp @@ -531,7 +531,7 @@ Result DmntCheatManager::GetFrozenAddress(FrozenAddressEntry *frz_addr, u64 add return 0; } -Result DmntCheatManager::EnableFrozenAddress(u64 address, u64 width) { +Result DmntCheatManager::EnableFrozenAddress(u64 *out_value, u64 address, u64 width) { std::scoped_lock lk(g_cheat_lock); if (!HasActiveCheatProcess()) { @@ -555,6 +555,7 @@ Result DmntCheatManager::EnableFrozenAddress(u64 address, u64 width) { } g_frozen_addresses_map[address] = value; + *out_value = value.value; return 0; } diff --git a/stratosphere/dmnt/source/dmnt_cheat_manager.hpp b/stratosphere/dmnt/source/dmnt_cheat_manager.hpp index 37525adb4..d1deb8ba6 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_manager.hpp +++ b/stratosphere/dmnt/source/dmnt_cheat_manager.hpp @@ -67,7 +67,7 @@ class DmntCheatManager { static Result GetFrozenAddressCount(u64 *out_count); static Result GetFrozenAddresses(FrozenAddressEntry *frz_addrs, size_t max_count, u64 *out_count, u64 offset); static Result GetFrozenAddress(FrozenAddressEntry *frz_addr, u64 address); - static Result EnableFrozenAddress(u64 address, u64 width); + static Result EnableFrozenAddress(u64 *out_value, u64 address, u64 width); static Result DisableFrozenAddress(u64 address); static void InitializeCheatManager(); diff --git a/stratosphere/dmnt/source/dmnt_cheat_service.cpp b/stratosphere/dmnt/source/dmnt_cheat_service.cpp index 8ccd6266c..966c0702d 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_service.cpp +++ b/stratosphere/dmnt/source/dmnt_cheat_service.cpp @@ -158,7 +158,7 @@ Result DmntCheatService::GetFrozenAddress(Out entry, u64 add return DmntCheatManager::GetFrozenAddress(entry.GetPointer(), address); } -Result DmntCheatService::EnableFrozenAddress(u64 address, u64 width) { +Result DmntCheatService::EnableFrozenAddress(Out out_value, u64 address, u64 width) { switch (width) { case 1: case 2: @@ -169,7 +169,7 @@ Result DmntCheatService::EnableFrozenAddress(u64 address, u64 width) { return ResultDmntCheatInvalidFreezeWidth; } - return DmntCheatManager::EnableFrozenAddress(address, width); + return DmntCheatManager::EnableFrozenAddress(out_value.GetPointer(), address, width); } Result DmntCheatService::DisableFrozenAddress(u64 address) { diff --git a/stratosphere/dmnt/source/dmnt_cheat_service.hpp b/stratosphere/dmnt/source/dmnt_cheat_service.hpp index abb43d523..422e8cff6 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_service.hpp +++ b/stratosphere/dmnt/source/dmnt_cheat_service.hpp @@ -73,7 +73,7 @@ class DmntCheatService final : public IServiceObject { Result GetFrozenAddressCount(Out out_count); Result GetFrozenAddresses(OutBuffer addresses, Out out_count, u64 offset); Result GetFrozenAddress(Out entry, u64 address); - Result EnableFrozenAddress(u64 address, u64 width); + Result EnableFrozenAddress(Out out_value, u64 address, u64 width); Result DisableFrozenAddress(u64 address); public: