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 


Multiple Constructor Modification

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

Joined: 02 Apr 2024
Posts: 1

PostPosted: Tue Apr 02, 2024 7:59 am    Post subject: Multiple Constructor Modification Reply with quote

I'm attempting to create a .CT file to modify a particular game that uses obfuscation and anti-cheat methods. I've found out that it has a custom double function that adds a constant value to every double upon storage, and then removes said value from every double upon access.
For example:
Code:

public double num
{
    get
    {
        return this.val - this.acVal;
    }
    set
    {
        this.val = value + this.acVal;
    }
}


I've tried modifying the particular getter/setter functions; however that doesn't seem to work as the assembly for this custom class seems to implant the code of the getter/setter functions into every location that it's called at. So instead, I've modified a few of the functions to remove the adding/subing of the constant value. Now, I've come to the issue where the game constantly recreates the variable(s) upon every modification.
For example:
Code:

public static CustomDouble operator +(CustomDouble a, CustomDouble b)
{
    return new CustomDouble(a.num + b.num);
}


So, I've decided to attempt to change the constructors as well to prevent these adding/subing operations (mainly due to not being able to figure out how to avoid creating new objects without entirely rewriting the code). My issue now is that there are multiple constructors with differing arguments, and I'm not sure how I can modify them all as after activating mono and disecting, there are a total of 6 ".ctor" functions that all have the same address label(s) through mono.

Is there a way to search for all of the function addresses using some kind of code? I know there's the "mono_class_enumMethods" function, but I can't figure out how to put the table into a human-readable format so that I know what I'm doing.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 943

PostPosted: Tue Apr 02, 2024 2:46 pm    Post subject: Reply with quote

The methods got inline-ed.
This may happened if it,
1. is simple, like some getter/setter that not call other function, even not obfuscated;
2. has 'inline' attribute;
3. is small struct, which mostly act like a 'value' instead of 'reference' as a class instance, ie. the 'value' is passing around instead of the 'ref' that point to a fixed 'variable storage';
etc.

Moreover, obfuscated type (and its method) may used by many context (eg. as money and shop_discount_rate), hacking on the obfuscated type method may has unexpected side effect in different context.

There may be other way. For me I'll look for their usage (most cil decompiler has the ability to 'find the usage').

For instance, if both 'money' and 'shop_discount_rate' are obfuscated, but you found they interact in a method call 'shop_buy', then what you need to found may greatly narrowed.

ie. instead of hacking the value directly, look for indirect way of thier usage.

_________________
- Retarded.
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 Lua Scripting 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