My questions: Why cannot modify value in picture of part Q1? (any address all cannot.)
But can modify in part Q2?
My C# code:
[DllImport("kernel32.dll")]
public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool WriteProcessMemory(int hProcess, int lpBaseAddress,byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
public static extern bool ReadProcessMemory(int hProcess,int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
static void Main(string[] args)
{
Process process = Process.GetProcessesByName("Defiance")[0];
IntPtr processHandle = OpenProcess(0x1F0FFF, false, process.Id);
int bytesWritten = 0;
byte[] buffer = Encoding.Unicode.GetBytes("test");
WriteProcessMemory((int)processHandle, 0x022AE000, buffer, buffer.Length, ref bytesWritten);
Console.ReadLine();
}