using Ryujinx.Common.Logging; using Ryujinx.HLE.HOS.Tamper.Operations; using System.Runtime.CompilerServices; namespace Ryujinx.HLE.HOS.Tamper { class Pointer : IOperand { private IOperand _position; private ITamperedProcess _process; public Pointer(IOperand position, ITamperedProcess process) { _position = position; _process = process; } public T Get() where T : unmanaged { return _process.ReadMemory(_position.Get()); } public void Set(T value) where T : unmanaged { ulong position = _position.Get(); Logger.Debug?.Print(LogClass.TamperMachine, $"0x{position:X16}@{Unsafe.SizeOf()}: {value:X}"); _process.WriteMemory(position, value); } } }