Say Ive got the following C# Code to read the memory based on offsets, why does it return 0000 (should be maximum health) , what am I doing wrong?
Reading static offsets works just fine, my memory reading class is not the problem.
Code:
private void button1_Click(object sender, EventArgs e)
{
Process[] m_p = Process.GetProcessesByName("WoW");
if (m_p[0] != null)
{
ProcessMemoryReader pmr = new ProcessMemoryReader();
pmr.ReadProcess = m_p[0];
pmr.OpenProcess();
long offset = 0xA560;
richTextBox1.AppendText("Base adress: "+pmr.ReadProcess.MainModule.BaseAddress.ToInt64().ToString("x")+"n");
richTextBox1.AppendText("Offset :" + offset.ToString("x") + "n");
long id = pmr.ReadProcess.MainModule.BaseAddress.ToInt64() + offset;
richTextBox1.AppendText("Offset+Base: " + id.ToString("x")+"n");
int readb;
byte[] bytes = pmr.ReadProcessMemory((IntPtr)id, 4,out readb);
string str = "";
foreach (byte b in bytes)
str += b;
richTextBox1.AppendText("Bytes read: "+readb.ToString("x")+"nData read: "+str+"n");
richTextBox1.ScrollToCaret();
pmr.CloseHandle();
}
}