2019-09-16 09:22:08 +01:00
|
|
|
/*
|
2021-10-04 20:59:10 +01:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2019-09-16 09:22:08 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stratosphere.hpp>
|
|
|
|
|
2019-10-24 10:30:10 +01:00
|
|
|
namespace ams::dmnt::cheat::impl {
|
2019-09-16 09:22:08 +01:00
|
|
|
|
2020-04-08 10:21:35 +01:00
|
|
|
void InitializeCheatManager();
|
|
|
|
|
2019-09-16 09:22:08 +01:00
|
|
|
bool GetHasActiveCheatProcess();
|
2021-10-05 01:12:32 +01:00
|
|
|
os::NativeHandle GetCheatProcessEventHandle();
|
2019-09-16 09:22:08 +01:00
|
|
|
Result GetCheatProcessMetadata(CheatProcessMetadata *out);
|
|
|
|
Result ForceOpenCheatProcess();
|
2020-04-25 01:24:15 +01:00
|
|
|
Result PauseCheatProcess();
|
|
|
|
Result ResumeCheatProcess();
|
2021-07-22 03:21:58 +01:00
|
|
|
Result ForceCloseCheatProcess();
|
2019-09-16 09:22:08 +01:00
|
|
|
|
|
|
|
Result ReadCheatProcessMemoryUnsafe(u64 process_addr, void *out_data, size_t size);
|
|
|
|
Result WriteCheatProcessMemoryUnsafe(u64 process_addr, void *data, size_t size);
|
|
|
|
|
2020-04-25 01:24:15 +01:00
|
|
|
Result PauseCheatProcessUnsafe();
|
|
|
|
Result ResumeCheatProcessUnsafe();
|
2020-04-25 01:00:43 +01:00
|
|
|
|
2019-09-16 09:22:08 +01:00
|
|
|
Result GetCheatProcessMappingCount(u64 *out_count);
|
2021-10-04 22:54:13 +01:00
|
|
|
Result GetCheatProcessMappings(svc::MemoryInfo *mappings, size_t max_count, u64 *out_count, u64 offset);
|
2019-09-16 09:22:08 +01:00
|
|
|
Result ReadCheatProcessMemory(u64 proc_addr, void *out_data, size_t size);
|
|
|
|
Result WriteCheatProcessMemory(u64 proc_addr, const void *data, size_t size);
|
2021-10-04 22:54:13 +01:00
|
|
|
Result QueryCheatProcessMemory(svc::MemoryInfo *mapping, u64 address);
|
2019-09-16 09:22:08 +01:00
|
|
|
|
|
|
|
Result GetCheatCount(u64 *out_count);
|
|
|
|
Result GetCheats(CheatEntry *cheats, size_t max_count, u64 *out_count, u64 offset);
|
|
|
|
Result GetCheatById(CheatEntry *out_cheat, u32 cheat_id);
|
|
|
|
Result ToggleCheat(u32 cheat_id);
|
2019-10-18 05:18:27 +01:00
|
|
|
Result AddCheat(u32 *out_id, const CheatDefinition &def, bool enabled);
|
2019-09-16 09:22:08 +01:00
|
|
|
Result RemoveCheat(u32 cheat_id);
|
2021-07-22 03:21:58 +01:00
|
|
|
Result SetMasterCheat(const CheatDefinition &def);
|
2020-04-25 01:00:43 +01:00
|
|
|
Result ReadStaticRegister(u64 *out, size_t which);
|
|
|
|
Result WriteStaticRegister(size_t which, u64 value);
|
|
|
|
Result ResetStaticRegisters();
|
2019-09-16 09:22:08 +01:00
|
|
|
|
|
|
|
Result GetFrozenAddressCount(u64 *out_count);
|
|
|
|
Result GetFrozenAddresses(FrozenAddressEntry *frz_addrs, size_t max_count, u64 *out_count, u64 offset);
|
|
|
|
Result GetFrozenAddress(FrozenAddressEntry *frz_addr, u64 address);
|
|
|
|
Result EnableFrozenAddress(u64 *out_value, u64 address, u64 width);
|
|
|
|
Result DisableFrozenAddress(u64 address);
|
|
|
|
|
|
|
|
}
|