-
Contributor
C# Memory Reading/Writing Class
Since i recieved messages about memory class used in my AH bot,here it is :P
Download ->
Memory.cs
How to :
1.Add existing item to project -> Memory.Cs
2.add "using ReadWriteMemory;" without quote marks
3.U must always use it like this
Code:
ProcessMemory memory_ = new ProcessMemory(proc_id);
memory_.StartProcess();
Since this memory class needs process id to work,here is how to do it for multiclient support etc...
Code:
private void Form1_Load(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("Diablo III");
foreach (Process proc in p)
{ comboBox1.Items.Add( proc.Id); }
}
//this will add every Diablo 3 client's process ID to comboBox
//add this to button1_Click event or anywhere u want
ProcessMemory memory_ = new ProcessMemory(comboBox1.SelectedItem.ToString());
memory_.StartProcess();
int price = memory_.ReadInt(memory_.ReadInt(memory_.ReadInt(memory_.ReadInt(memory_.ImageAddress() + 0x00FC7590)) + 0xC) + 0xD8);
return price;
//this will return AH item 1 buyout price :D
-
Post Thanks / Like - 1 Thanks
JeffC# (1 members gave Thanks to yellowspark for this useful post)
-
yet another BlackMagic inspired lib...
-
Member
I LOVE THIS GUY! finally somebody that posted something that i asked for
-
Contributor
Thx for the awesome library. Can you possibly do an example on how to read a string?
-
Code:
ProcessMemory memory_ = new ProcessMemory(proc_id);
memory_.StartProcess();
private void Form1_Load(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("Diablo III");
foreach (Process proc in p)
{ comboBox1.Items.Add( proc.Id); }
}
//this will add every Diablo 3 client's process ID to comboBox
//add this to button1_Click event or anywhere u want
ProcessMemory memory_ = new ProcessMemory(comboBox1.SelectedItem.ToString());
memory_.StartProcess();
//pOffset is the addess, pSize the length of the string...
string yourString = memory_.ReadStringAscii(pOffset, pSize);
No idea if that works lols
-
Contributor
Originally Posted by
DarkLinux
Code:
ProcessMemory memory_ = new ProcessMemory(proc_id);
memory_.StartProcess();
private void Form1_Load(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("Diablo III");
foreach (Process proc in p)
{ comboBox1.Items.Add( proc.Id); }
}
//this will add every Diablo 3 client's process ID to comboBox
//add this to button1_Click event or anywhere u want
ProcessMemory memory_ = new ProcessMemory(comboBox1.SelectedItem.ToString());
memory_.StartProcess();
//pOffset is the addess, pSize the length of the string...
string yourString = memory_.ReadStringAscii(pOffset, pSize);
No idea if that works lols
I got it to work. It is basically the same as the integer but on the last bracket you do readascii instead of readint.
-
Private
Two questions:
1. Is it better to create a new instance of the class for every memory read/write? or use a single instance throughout the lifetime of the application (bot)
2. In the example above, the handle retrieved by OpenProcess is never closed (using CloseHandle). Do you think it would be a good idea to make the class IDisposable? (see example IDisposable Interface (System))
-
Private
Anybody know if this still works? I get it up and running but all it returns is 0.
-
Private
Last edited by Crackerzoid; 09-25-2012 at 11:05 AM.