Hello!
I want to read data from my ram. But there are some Problems.
The MemoryScanner says that in the adress: 0x2604090 is the value: 1794.
But when i read that adress then i get a 0 back :(
I hope you can help me
PS: Sorry for my bad english :)
Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Windows.Forms;
namespace ReadMemory
{
public partial class Form1 : Form
{
MemoryScanner.ProcessMemoryReader reader = new MemoryScanner.ProcessMemoryReader();
int[] ProcessIDs;
public Form1()
{
InitializeComponent();
Process[] Temp;
Temp = Process.GetProcesses();
ProcessIDs = new int[Temp.Length];
for (int i = 0; i < Temp.Length; i++)
{
listBox1.Items.Add(Temp[i].ProcessName.ToString());
ProcessIDs[i] = Temp[i].Id;
}
}
private void button1_Click(object sender, EventArgs e)
{
reader.OpenProcess();
int results = 0;
uint bytesToRead = 20480;
int bytesRead = 0;
byte[] result = reader.ReadProcessMemory((IntPtr)0x2604090, bytesToRead, out bytesRead);
if (bytesRead <= 0)
{
MessageBox.Show("No Bytes are readed!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
for (int i = 0; i < result.Length; i++)
results += result[i];
richTextBox1.Text += results + Environment.NewLine;
}
}
private void button2_Click(object sender, EventArgs e)
{
byte[] WriteBytes = {255};
int WrittenBytes = 0;
reader.WriteProcessMemory((IntPtr)0x2604090, WriteBytes, out WrittenBytes);
if(WrittenBytes <=0)
MessageBox.Show("No Bytes are written!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
MessageBox.Show("Successfully written!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
reader.ReadProcess = Process.GetProcessById(ProcessIDs[listBox1.SelectedIndex]);
}
}
}
I took the MemoryScanner.cs from the MemoryScanner ;)