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 


Where do I start with making a table for a Mono game?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Kellan2255
How do I cheat?
Reputation: 0

Joined: 17 Apr 2022
Posts: 3

PostPosted: Sun Apr 17, 2022 3:56 pm    Post subject: Where do I start with making a table for a Mono game? Reply with quote

I've found the values I want in a game and I want to start putting them into a table or script. The problem is it uses Unity. To find the values I had to open the Mono dissector, find the class I wanted, click "Find instances of class", and click through the predictions until I found the correct one.


How do I even begin getting the class's address? The only tutorial I saw was this video, but it only shows how to modify a class' methods. There has a consistent, reproducible, and automated way that's better than me clicking around menus while changing values in the game. Do I do a pointer scan until I find a static pointer I can always work from like before, or does that not work due to the dynamic nature of C# programs? I assume once I have the address I can also use
Code:
mono_class_findMethod
, since I have the class and method names, then
Code:
mono_invoke_method
with the address as an argument to call whatever functions I want.

Last edited by Kellan2255 on Sun Apr 17, 2022 5:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3344

PostPosted: Sun Apr 17, 2022 4:18 pm    Post subject: Reply with quote

Hacking mono games is more or less the same as hacking normal games.
You start with looking for values, you see where they belong and there they lead you.
With mono however, you have the benefit of knowing what exactly you are looking at: vValues, classes, their methods and variables.
And that makes it very easy to hack mono games, great for beginners.

That, plus keep in mind mono code is compiled in runtime.
That means the compiled code may a) be anywhere in the memory (so fixed offsets won't work) and b) the code compiled for your CPU may be different than somebody elses.
I would worry about a) only, because that can lead to crashes in case you get JMP14 instructions instead of JMP5s.

Lastly, once you hacked a game and you know exactly what you are looking for, you can use mono dissect and go directly to the class/method/variable you need.
Back to top
View user's profile Send private message
Kellan2255
How do I cheat?
Reputation: 0

Joined: 17 Apr 2022
Posts: 3

PostPosted: Sun Apr 17, 2022 4:42 pm    Post subject: Reply with quote

Csimbi wrote:
That means the compiled code may a) be anywhere in the memory (so fixed offsets won't work).


That's exactly where I got confused. How am I supposed to make a cheat table if I don't know where anything is? The only thing I can think of is searching for an array of bytes, and the classes I want have little to no consistent values or byte signatures I could look for.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3344

PostPosted: Mon Apr 18, 2022 2:54 am    Post subject: Reply with quote

Kellan2255 wrote:
The only thing I can think of is searching for an array of bytes, and the classes I want have little to no consistent values or byte signatures I could look for.

That's exactly what you do - except you search for code, not objects.
Back to top
View user's profile Send private message
Kellan2255
How do I cheat?
Reputation: 0

Joined: 17 Apr 2022
Posts: 3

PostPosted: Mon Apr 18, 2022 6:46 pm    Post subject: Reply with quote

Would it be a good idea (or even possible) to inject code into a class' constructor that gets the base address? If I can, I feel like it would be better to have a way to directly modify certain variables (i.e. position and score) instead of making a script that modifies a function for each one. Or would that be stupid?
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 98

Joined: 14 Jul 2007
Posts: 3344

PostPosted: Tue Apr 19, 2022 2:28 am    Post subject: This post has 1 review(s) Reply with quote

Kellan2255 wrote:
Would it be a good idea (or even possible) to inject code into a class' constructor that gets the base address?

The Constructor?
Sure, it can be done but you'd have to start threads and timers because the constructor is executed only once and you have no clue how long the object is valid - unless of course you inject your own cleanup code into the Destructor as well.
Instead, I'd find a 'good candidate' of a function or a procedure that runs when needed.
Good candidates are those that read or write the values you need, so you can update the value in the register directly (as opposed to having to fiddle with a value in the memory).
The first step is gaining a good understanding of how the software works and how the data you'd like to modify is accessed and modified.
Having done that, you will have already identified the best candidate to inject your own code and you will also have a very good idea regarding what your code needs to do.
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 All times are GMT - 6 Hours
Page 1 of 1

 
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