Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C# Trainer Tutorial (With Example)
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
unknown_k
Expert Cheater
Reputation: 5

Joined: 24 May 2011
Posts: 211

PostPosted: Tue Jul 30, 2013 7:00 pm    Post subject: Reply with quote

Splamy wrote:
I know this Topic is pretty old, but I've seen a mistake an I'd like to correct it:
in the public static string Make(byte[] buffer) function you have to change the
if (Convert.ToInt16(buffer[i]) < 10)
to
if (Convert.ToInt16(buffer[i]) <= 0xF)
because in hex for example the number 15(0xF) is only 1 digit long


and w/o if else
Code:
sTemp = b[i].ToString("X2") + sTemp;
Back to top
View user's profile Send private message
krazybeat
How do I cheat?
Reputation: 0

Joined: 17 Jan 2011
Posts: 1

PostPosted: Tue Oct 22, 2013 3:43 pm    Post subject: Reply with quote

how to write one byte?
Back to top
View user's profile Send private message
ProjectEz
Newbie cheater
Reputation: 0

Joined: 03 Dec 2011
Posts: 18
Location: Phlippines

PostPosted: Thu May 08, 2014 7:07 am    Post subject: Reply with quote

Thank you TS for this, much help for me studying about trainers and hacks Smile
I understand the code well!
More power!
Back to top
View user's profile Send private message
Itachi08
Expert Cheater
Reputation: 0

Joined: 03 Nov 2006
Posts: 101

PostPosted: Tue Jun 10, 2014 5:06 pm    Post subject: Reply with quote

so using the Memory class .. can i make an application that can scan through a process memory aswell?..

lets say i give it a value to search and
1 .start from 0x00400000 for example.
2. if value at the address matches save it to an array
3. lets say if the value is 4 bytes i'll do (currentAddress + 0x4)??

the reason i am asking is because cheatengine is detected on many games.. however trainers i made using c# do not..

_________________
Back to top
View user's profile Send private message
KryziK
Expert Cheater
Reputation: 3

Joined: 16 Aug 2009
Posts: 199

PostPosted: Tue Jun 10, 2014 7:18 pm    Post subject: Reply with quote

Itachi08 wrote:
so using the Memory class .. can i make an application that can scan through a process memory aswell?..

lets say i give it a value to search and
1 .start from 0x00400000 for example.
2. if value at the address matches save it to an array
3. lets say if the value is 4 bytes i'll do (currentAddress + 0x4)??

the reason i am asking is because cheatengine is detected on many games.. however trainers i made using c# do not..


You could potentially read large chunks of data at a time (with a for loop that has a read inside where the address to read from keeps incrementing). Then, you look within the data you read and if you find the value you want, add the current address plus the offset in the bytes that you read to get the full address of the value.

Pseudo-code:

For (address = 0x00400000 to whenever you want to stop)
    Read 1024 bytes from address
    Search for the value inside of those bytes, store the offset where it was found.
    If found, add address + the offset of the value in bytes
    Increment address by the number of bytes you just read to avoid reading the same addresses.
Back to top
View user's profile Send private message
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Thu Nov 13, 2014 3:18 am    Post subject: Reply with quote

There's also a library called ProcessMemory that lets you do this just by calling extension methods on System.Diagnostics.Process instances. I used it to make my RAM corruptor, which is fun in emulators and stuff.
Back to top
View user's profile Send private message
KryziK
Expert Cheater
Reputation: 3

Joined: 16 Aug 2009
Posts: 199

PostPosted: Thu Nov 13, 2014 1:35 pm    Post subject: Reply with quote

flarn2006 wrote:
There's also a library called ProcessMemory that lets you do this just by calling extension methods on System.Diagnostics.Process instances. I used it to make my RAM corruptor, which is fun in emulators and stuff.


I'm sure there are plenty of other methods and existing libraries to do what this one does. In fact, this one is quite outdated. However, I provided it as a tutorial back when I didn't know too much about it. It was more of a learning experience for me and something that newer people could follow.

Thank you for posting an alternative. However, please don't revive such an old thread if you don't have a question about something.

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites