View previous topic :: View next topic |
Author |
Message |
Sharkdeed How do I cheat? Reputation: 0
Joined: 18 Jul 2014 Posts: 8
|
Posted: Sun Jul 27, 2014 3:55 am Post subject: [C#]Reading and Writing Values |
|
|
Hey guys i've been working on a quake3 trainer by getting help by a class that was made by "Cless" Link to the topic :
forum(dot)cheatengine(dot)org/viewtopic(dot)php?p=5347687
My question is, i can read addresses but when i try to add offsets it gets messy. I'm making a mistake obviously. Here is my pointer scan result(it works in CE) :
i60(dot)tinypic(dot)com/ddyyjr.png
and here is the line that i couldn't make it work !
Code: | label2.Text = Trainer.ReadPointerByte("quake3", 0x0026CD40, new int[1] { 0x5e0 }).ToString(); |
Thanks in advance
|
|
Back to top |
|
|
661089799107 Expert Cheater Reputation: 3
Joined: 25 Jan 2009 Posts: 186
|
Posted: Sun Jul 27, 2014 4:02 am Post subject: |
|
|
Should probably use ReadPointerInteger instead of ReadPointerByte since the type of your health is 4 bytes.
Also should "quake3" be "quake3.exe"?
|
|
Back to top |
|
|
Sharkdeed How do I cheat? Reputation: 0
Joined: 18 Jul 2014 Posts: 8
|
Posted: Sun Jul 27, 2014 4:08 am Post subject: |
|
|
661089799107 wrote: | Should probably use ReadPointerInteger instead of ReadPointerByte since the type of your health is 4 bytes.
Also should "quake3" be "quake3.exe"? |
Thank you for your quick help ! However, when i try to use that method, result always returns as 0
Here how i used it :
Code: | label2.Text = Trainer.ReadPointerInteger("quake3", 0x0026CD40, new int[1] { 0x5e0 }).ToString(); |
Also, it adds ".exe" by itself and gets the id of the process and works on it i think. Thats why when i type .exe there it fails.
Thanks
|
|
Back to top |
|
|
661089799107 Expert Cheater Reputation: 3
Joined: 25 Jan 2009 Posts: 186
|
Posted: Sun Jul 27, 2014 4:20 am Post subject: |
|
|
The memory class that you are using doesn't appear to get the base address of the exe (quake3.exe), and add it to the pointer offset (0x0026CD40).
This is what you want: (though make sure you cache the base address instead of calling it every time)
Code: |
label2.Text = Trainer.ReadPointerInteger("quake3", getBaseAddress("quake3")+0x0026CD40, new int[1] { 0x5e0 }).ToString();
|
As for implementing getBaseAddress you would use Createtoolhelp32snapshot and Module32First. There are also plenty of examples on the forum/google for doing so.
|
|
Back to top |
|
|
Sharkdeed How do I cheat? Reputation: 0
Joined: 18 Jul 2014 Posts: 8
|
Posted: Sun Jul 27, 2014 4:55 am Post subject: |
|
|
661089799107 wrote: | The memory class that you are using doesn't appear to get the base address of the exe (quake3.exe), and add it to the pointer offset (0x0026CD40).
This is what you want: (though make sure you cache the base address instead of calling it every time)
Code: |
label2.Text = Trainer.ReadPointerInteger("quake3", getBaseAddress("quake3")+0x0026CD40, new int[1] { 0x5e0 }).ToString();
|
As for implementing getBaseAddress you would use Createtoolhelp32snapshot and Module32First. There are also plenty of examples on the forum/google for doing so. |
Thank you for your help now i understand it very clearly !!
Topic can be closed now.
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Sun Jul 27, 2014 9:26 pm Post subject: |
|
|
In C# you can make use of the Process class instead of invoking the API yourself manually:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx
You can use this to get information on processes, their base addresses, their module / thread information etc.
_________________
- Retired. |
|
Back to top |
|
|
|