Question Modifying a field in a static class

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Paradigm

Dank Tier Donator
Full Member
Aug 17, 2020
4
322
0
I've seen @HelloWhyMe tutorial on how to access fields through function pointers however I believe that only works with instances of classes.

How would I go about modifying a field within a static class like below...


C#:
public static class Constants // TypeDefIndex: 6559
{
    // Fields
    public static ScaleEnvironment ScaleEnvironment; // 0x0
    public static bool showDebugOptions; // 0x4
    public static bool sendLogsFromNetworkErrorPopup; // 0x5
    public const bool fileLoggingEnabled = False;
    public const bool nsLoggingEnabled = False;
    public const ThriftServer.TraceLevel traceNetworkRequests = 1;
    public static bool networkSimulation; // 0x6
    public const float networkDelayChance = 0.25;
    public const float networkDropChance = 0.2;
    public const float networkRestartChance = 0.05;
    public static bool drawBattleFPS; // 0x7
    public static bool startBattleWithOnlyOneHealth; // 0x8

    // Methods

    // RVA: 0x15EAF1C Offset: 0x15EAF1C VA: 0x15EAF1C
    public static ServerEnvironment GetCurrentEnv(Dictionary<string, ServerEnvironment> envDictionary, string defaultEnvKey, bool debugOptionsEnabled) { }

    // RVA: 0x15EB130 Offset: 0x15EB130 VA: 0x15EB130
    private static void .cctor() { }
}
 

ezb266

Egg
Dank Tier Donator
Feb 7, 2018
44
803
1
I had a similar problem which I resolved, I can help you but it'll be easier if u tell me what game you are using.
 

ezb266

Egg
Dank Tier Donator
Feb 7, 2018
44
803
1

Paradigm

Dank Tier Donator
Full Member
Aug 17, 2020
4
322
0
Never done game hacking on mobile games before, so this is kind of new to me. I know I am supposed to be answering your question but how do you get the GameAssembly.dll or Assembly-CSharp.dll, I used apktool and went to assets/bin/Data/Managed but its empty.
I used il2cpp dumper to generate the dump.cs and the Assembly-CSharp.dll
 

eybisi

Dank Tier Donator
Oct 5, 2020
3
338
0
Hi, If you use il2cppInspector, it gives you the offset to const fields. Then you can go to global.metadata file to edit.

Changing const fields: (for your game):

Screenshot_126.png


If you open up global.metadata file and go to offset 0x63ca15:

Screenshot_127.png


IDK if it makes sense to change uninitiliazed static fields but you can do that with constructor of that class. For example look at the numbers after +0x17, they all represent the static fields mentinoned in the .cs file :

Screenshot_128.png


Screenshot_129.png
 
  • Like
Reactions: Rake
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods