プロセス ベース アドレス + ベース ポインター + オフセットの組み合わせを使用して、メモリからデータを読み取っています。これまでのところ、5 つのケースのうち 4 つのケースで意図したとおりに機能しています。
私の5回目の試行で、以下の例外がスローされます。address
引数の値のためですか?
OverflowException: 算術演算でオーバーフローが発生しました
public static int ReadInt(long address)
{
byte[] buffer = new byte[sizeof(int)];
ReadProcessMemory(PHandle, (UIntPtr)address, buffer,
(UIntPtr)4, IntPtr.Zero);
//(UIntPtr)address: -1482250587
return BitConverter.ToInt32(buffer, 0);
}