| View previous topic :: View next topic |
| Author |
Message |
Damein Newbie cheater
Reputation: 0
Joined: 29 Sep 2010 Posts: 12
|
Posted: Thu Sep 30, 2010 2:15 pm Post subject: Creating a program to read memory and do x if active |
|
|
Alright, so I want to make a program that reads the memory of a game, and if the memory has a value of anything other then 0 I want to be able to close the game. But I don't know how to approach this, any help would be nice, thanks
|
|
| Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Thu Sep 30, 2010 3:59 pm Post subject: |
|
|
If you know a specific address it would be easier, assuming your game is not using dynamic memory allocation. Otherwise with the known address something like.
This is psuedo code
C# method
| Code: |
using System.Diagnostics;
do(
}while( 0xADDRESS == 0 )
if( 0xADDRESS != 0 )
{
if (clsProcess.ProcessName.StartsWith(name))
{
clsProcess.Kill();
}
}
|
_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
| Back to top |
|
 |
Geri Moderator
Reputation: 112
Joined: 05 Feb 2010 Posts: 5627
|
Posted: Thu Sep 30, 2010 4:26 pm Post subject: |
|
|
In a CE script, it would look like this:
| Code: | cmp [address],0
je forward
pushad
pushfd
popad
popfd |
Now that will cause a crash for sure.
(Was joking, but it would really work...)
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Sep 30, 2010 4:32 pm Post subject: |
|
|
Obtain the main thread of the application and kill it (TerminateThread). You can use CreateToolhelp32Snapshot with Thread32First/Thread32Next to loop the applications thread list and such.
A better / more proper way of closing the application would be to find the function inside the application responsible for properly closing the game normally and calling that, if you are able to find it.
Forcing the app to close can cause leaks / data loss depending on how the game / application is designed. So find which method works for your instance.
_________________
- Retired. |
|
| Back to top |
|
 |
Damein Newbie cheater
Reputation: 0
Joined: 29 Sep 2010 Posts: 12
|
Posted: Thu Sep 30, 2010 7:56 pm Post subject: |
|
|
I do have the address, and it doesn't change.
Question: Are these scripts I can send to someone without CE and they can still run it?
I will look into CE scripts ASAP
|
|
| Back to top |
|
 |
Geri Moderator
Reputation: 112
Joined: 05 Feb 2010 Posts: 5627
|
Posted: Thu Sep 30, 2010 8:03 pm Post subject: |
|
|
If You write a script in CE, You can create a trainer from it with CE's built-in trainer maker. But seriously don't use the method that I have posted. It will really work and it will probaly really cause a giant crash but not a proper process termination. It is just a way to mess up register values which accidently happens if someone doesn't careful but shouldn't be used on purpose.
_________________
|
|
| Back to top |
|
 |
Damein Newbie cheater
Reputation: 0
Joined: 29 Sep 2010 Posts: 12
|
Posted: Sat Oct 02, 2010 10:04 pm Post subject: |
|
|
AhMunRa's script looks simple and effect.. but I don't know the commands of CE scripts.
Here is what I want to happen, just to test and then when I know how to create a trainer and make sure its working I'll focus on it doing exactly what I want to do.
| Code: |
using System.Diagnostics;
do(
; Maybe force the user to type something so Know it works.
}while( 0xADDRESS == 0 )
if( 0xADDRESS != 0 )
{
if (clsProcess.ProcessName.StartsWith(name))
{
clsProcess.Kill();
}
} |
Basically, all I want at the moment is a test script so I can test different addresses and make sure I can do this.
Thanks
|
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Sun Oct 03, 2010 1:15 am Post subject: |
|
|
You won't be able to access the memory in the fashion you're prototyping. Polling it constantly is also a mistake - it's going to consume huge CPU.
-cheers
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Sun Oct 03, 2010 3:21 am Post subject: |
|
|
Hook some the code accessing the value and do eg. | Code: | cmp eax,0x12345678
je 0
...else return... |
Or if you need to poll it somewhere else: | Code: | cmp [address],0x12345678
je 0
...else continue the flow... |
|
|
| Back to top |
|
 |
AhMunRa Grandmaster Cheater Supreme
Reputation: 27
Joined: 06 Aug 2010 Posts: 1117
|
Posted: Sun Oct 03, 2010 10:50 am Post subject: |
|
|
That code I posted is just one way of attempting to do this. This code would not run from CE it would be a stand alone exe build in C#. There would be a ton of other stuff you would have to learn to get it to work properly. For instance, accessing memory of another process for the actual monitoring part. C# should handle proper shut down of the app to prevent memory leaks, but I wouldn't count on it.
Wiccan is a much better coder than I am. What he says you can pretty much take as code gospel.
_________________
<Wiccaan> Bah that was supposed to say 'not saying its dead' lol. Fixing >.> |
|
| Back to top |
|
 |
|