|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Rolingo How do I cheat? Reputation: 0
Joined: 29 Jan 2013 Posts: 2
|
Posted: Tue Jan 29, 2013 2:39 pm Post subject: |
|
|
Hi and thanks for the memory library!
I got a questin, I'm trying to read the current amount of money from Euro truck simulator 2.
This is how I do it in CE adding a static pointer. eurotrucks2.exe+66D5EC and 24,20 as offsets. Type as 8 bytes. Works great.
When Im trying to do this in C# with KryziK memory library, I do it like this:
Code: |
Memory m = new Memory();
if (m.OpenProcess("eurotrucks2"))
{
textBox1.Text = "EuroTruck process found!";
int baseAddress = m.BaseAddress();
int[] offsets = { 0x24, 0x20 };
int pointer = 0x66D5EC;
long currentMoney = m.ReadLong(baseAddress + pointer, offsets);
textBox1.Text = currentMoney.ToString();
}
|
This return something that is NOT the current amount of money.
I figured the value I want to read is in 8-bit so I use the method ReadLong for that.
Anybody have an idea what might be wrong?
|
|
Back to top |
|
|
Inzann Cheater Reputation: 0
Joined: 03 Jan 2007 Posts: 34
|
Posted: Wed Jan 30, 2013 3:46 pm Post subject: |
|
|
Rolingo wrote: | Hi and thanks for the memory library!
I got a questin, I'm trying to read the current amount of money from Euro truck simulator 2.
This is how I do it in CE adding a static pointer. eurotrucks2.exe+66D5EC and 24,20 as offsets. Type as 8 bytes. Works great.
When Im trying to do this in C# with KryziK memory library, I do it like this:
Code: |
Memory m = new Memory();
if (m.OpenProcess("eurotrucks2"))
{
textBox1.Text = "EuroTruck process found!";
int baseAddress = m.BaseAddress();
int[] offsets = { 0x24, 0x20 };
int pointer = 0x66D5EC;
long currentMoney = m.ReadLong(baseAddress + pointer, offsets);
textBox1.Text = currentMoney.ToString();
}
|
This return something that is NOT the current amount of money.
I figured the value I want to read is in 8-bit so I use the method ReadLong for that.
Anybody have an idea what might be wrong? |
Don't you need to add the module base address to the pointer? I might be very wrong about what the problem is but I had a similar problem and it helped me.
I think its usually 400000 for most applications so just do 400000 + 66D5EC with hex calculator and maybe it'll work. It should be A6D5EC.
|
|
Back to top |
|
|
Rolingo How do I cheat? Reputation: 0
Joined: 29 Jan 2013 Posts: 2
|
Posted: Wed Jan 30, 2013 5:16 pm Post subject: |
|
|
Inzann wrote: | Rolingo wrote: | Hi and thanks for the memory library!
I got a questin, I'm trying to read the current amount of money from Euro truck simulator 2.
This is how I do it in CE adding a static pointer. eurotrucks2.exe+66D5EC and 24,20 as offsets. Type as 8 bytes. Works great.
When Im trying to do this in C# with KryziK memory library, I do it like this:
Code: |
Memory m = new Memory();
if (m.OpenProcess("eurotrucks2"))
{
textBox1.Text = "EuroTruck process found!";
int baseAddress = m.BaseAddress();
int[] offsets = { 0x24, 0x20 };
int pointer = 0x66D5EC;
long currentMoney = m.ReadLong(baseAddress + pointer, offsets);
textBox1.Text = currentMoney.ToString();
}
|
This return something that is NOT the current amount of money.
I figured the value I want to read is in 8-bit so I use the method ReadLong for that.
Anybody have an idea what might be wrong? |
Don't you need to add the module base address to the pointer? I might be very wrong about what the problem is but I had a similar problem and it helped me.
I think its usually 400000 for most applications so just do 400000 + 66D5EC with hex calculator and maybe it'll work. It should be A6D5EC. |
Thanks for the suggestion, the module base is 4194304 for (eurotrucks2.exe). Tried to add it with hex calulator, but still getting wrong value as return.
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|