| View previous topic :: View next topic |
| Author |
Message |
cheatenginenoob Cheater
Reputation: 0
Joined: 03 Jan 2007 Posts: 45 Location: behind you
|
Posted: Mon Dec 19, 2011 1:52 am Post subject: Making a trainer in c#? |
|
|
I remember seeing some tutorials for making trainers, but I didn't know how to program then.
I'm looking for something in c# with VS. _________________
"I wish my lawn was emo so it would cut itself" |
|
| Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Mon Dec 19, 2011 8:31 am Post subject: |
|
|
| You want to change memory? Use WriteProcessMemory() api for that. |
|
| Back to top |
|
 |
Unbr0ken Advanced Cheater
Reputation: 2
Joined: 10 Aug 2011 Posts: 67
|
Posted: Mon Dec 19, 2011 2:43 pm Post subject: |
|
|
| NoMercy wrote: | | You want to change memory? Use WriteProcessMemory() api for that. |
And...
| Code: | using System.Diagnostics;
using System.Runtime.InteropServices;
OpenProcess()
VirtualProtectEx()
CloseHandle() |
PInvoke can help you a lot. |
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Dec 19, 2011 3:54 pm Post subject: |
|
|
| Unbr0ken wrote: | | NoMercy wrote: | | You want to change memory? Use WriteProcessMemory() api for that. |
And...
| Code: | using System.Diagnostics;
using System.Runtime.InteropServices;
OpenProcess()
VirtualProtectEx()
CloseHandle() |
PInvoke can help you a lot. |
It can also be done without using
OpenProcess()
VirtualProtectEx()
CloseHandle()
I only use
WriteProcessMemory
ReadProcessMemory _________________
|
|
| Back to top |
|
 |
Unbr0ken Advanced Cheater
Reputation: 2
Joined: 10 Aug 2011 Posts: 67
|
Posted: Mon Dec 19, 2011 4:20 pm Post subject: |
|
|
| Pingo wrote: | | Unbr0ken wrote: | | NoMercy wrote: | | You want to change memory? Use WriteProcessMemory() api for that. |
And...
| Code: | using System.Diagnostics;
using System.Runtime.InteropServices;
OpenProcess()
VirtualProtectEx()
CloseHandle() |
PInvoke can help you a lot. |
It can also be done without using
OpenProcess()
VirtualProtectEx()
CloseHandle()
I only use
WriteProcessMemory
ReadProcessMemory |
Why not use the correct way?...
By the way, how do you establish the access to the handle of the process?... to my knowledge, if you don't set the correct access (PROCESS_VM_WRITE or PROCESS_VM_READ) you couldn't read/write memory (If the chunk of memory haven't read/write access). |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Mon Dec 19, 2011 4:23 pm Post subject: |
|
|
OpenProcess / CloseHandle aren't absolutely needed in .NET except for extreme conditions with some applications. The Process class exposes a handle for you that you can use rather then needing API or worrying about closing the handle yourself.
Assuming you are using VS2010, you can use Linq for making queries easy on the running processes for example:
| Code: |
Process p = (from Process proc in Process.GetProcessesByName("winmine")
select proc).FirstOrDefault();
if (p != null)
{
// Do stuff with our process here..
// p.Handle for anything that requires a
// process handle to be used.
}
|
Then for example if you need a base address from this process for something like, 'winmine.exe'+15123, you can do:
| Code: |
Process p = (from Process proc in Process.GetProcessesByName("winmine")
select proc).FirstOrDefault();
if (p != null)
{
IntPtr lpBaseAddress = (from ProcessModule mod in p.Modules
where mod.ModuleName == "winmine.exe"
select mod.BaseAddress).SingleOrDefault();
}
|
And so on, then you can just use pinvoke for ReadProcessMemory/WriteProcessMemory. _________________
- Retired. |
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Mon Dec 19, 2011 7:01 pm Post subject: |
|
|
Blame Wiccaan, he converted me ages ago. At one point i did use these api's but iv not had many problems since, except for those rare occasions.
Alot less code needed, and when i find cleaner ways of coding, i stick with it. _________________
|
|
| Back to top |
|
 |
cheatenginenoob Cheater
Reputation: 0
Joined: 03 Jan 2007 Posts: 45 Location: behind you
|
Posted: Tue Dec 20, 2011 10:49 pm Post subject: |
|
|
Woah. A little more info than that please. I have no idea which memory I need to edit. How do I find the location of the variables? How did you guys learn this stuff? _________________
"I wish my lawn was emo so it would cut itself" |
|
| Back to top |
|
 |
Unbr0ken Advanced Cheater
Reputation: 2
Joined: 10 Aug 2011 Posts: 67
|
Posted: Tue Dec 20, 2011 11:54 pm Post subject: |
|
|
| cheatenginenoob wrote: | | Woah. A little more info than that please. I have no idea which memory I need to edit. How do I find the location of the variables? How did you guys learn this stuff? |
Start use the CE...
Do the CE Tutorial, and then go modify the memory of some game.
You must not run if you can't walk. |
|
| Back to top |
|
 |
|