Help! Modify ObscuredInt methods from an il2cpp game without hooking

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
36,149
1,193
japaneseland
Is there any way to mod ObscuredInt values of il2cpp games without hooking?

I know it's just way better to hook it (or the only way to modify them, I don't know), but I still wanna learn to do it manually if it's possible.

In this case, it's 3 different ObscuredInt that directly reference the value of 3 currencies, and the game has CodeStage (a joke of an anticheat, I know :pepe001:)

Whether it's by hex patching, editing ARM code with IDA or something of the like, doesn't matter. I wanna eat knowledge today.

I'm currently waiting for IDA to load the libil2cpp.so file, and I don't really know if I'm gonna be able to achieve anything by looking and editing the ARM code directly.

Any sort of help is well-received, whether you take your time to give me specific info or just provide me with a specific guide / tutorial (I haven't found anything this specific by myself).

Appreciate your time :pepe023:
 

mIsmanXP

Approved Modder
Approved Modder
Feb 20, 2022
205
9,885
193
Republic of Indonesia
create a new instance of ObscuredInt
call the setter method for the ObscuredInt field if there's any.
this is roughly how you would do it with frida-il2cpp-bridge/
JavaScript:
    const ass = domain.assembly("Assembly-CSharp");
    const image = ass.image;

    const SurvivorInGame = image.class("Survivor.Game.SurvivorInGame");
    const method = SurvivorInGame.method("set_EnemyKillCount");
    const ObscuredInt = SurvivorInGame.field<Il2Cpp.ValueType>(
        "<EnemyKillCount>k__BackingField" //is of type ObscuredInt
    ).value.type.class; //get Class instance of ObscuredInt
    const newValueObj = ObscuredInt.new();
    newValueObj.method(".ctor").invoke(99);

    method.invoke(newValueObj.unbox());
in c++, maybe you can achieve this with BNM lib, but idk, never tried it
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
36,149
1,193
japaneseland
create a new instance of ObscuredInt
call the setter method for the ObscuredInt field if there's any.
this is roughly how you would do it with frida-il2cpp-bridge/
JavaScript:
    const ass = domain.assembly("Assembly-CSharp");
    const image = ass.image;

    const SurvivorInGame = image.class("Survivor.Game.SurvivorInGame");
    const method = SurvivorInGame.method("set_EnemyKillCount");
    const ObscuredInt = SurvivorInGame.field<Il2Cpp.ValueType>(
        "<EnemyKillCount>k__BackingField" //is of type ObscuredInt
    ).value.type.class; //get Class instance of ObscuredInt
    const newValueObj = ObscuredInt.new();
    newValueObj.method(".ctor").invoke(99);

    method.invoke(newValueObj.unbox());
in c++, maybe you can achieve this with BNM lib, but idk, never tried it
This looks really interesting! I'm gonna try it just out of how cool it looks :pepe018:

Also, there's no other way to get these ObscuredInt methods to throw new values by only modifying ARM / hex code, right?
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
36,149
1,193
japaneseland
Nothing that I'm aware of
Alright, thank you very much! :pepe023:

I guess I'll have to make a mod menu so I can share it for everyone :pepe016:

I found here some threads with valuable info about hooking Obscured types with LGL menu, so it's useful for my specific case. I just have to figure things out as I don't know much about C/C++ coding.

Would you say I should learn C++ for becoming a modding master?
 

JohnnyCappucino

Platinian
Aug 26, 2023
20
5
3
24
Sweden
You could easily hexpatch an obscuredint data type, but in most cases it will remain only visual, so, hooking methodology is superior.

Also, this type of data is holding the real value, and you can currently achieve it only by hooking it. (There could be cases where they don't remain visual when hexpatching, but these exceptions are not representing the reality.).
 

NotAWeeb!

1/3 Games Approved
Original poster
Aug 31, 2023
202
36,149
1,193
japaneseland
You could easily hexpatch an obscuredint data type, but in most cases it will remain only visual, so, hooking methodology is superior.

Also, this type of data is holding the real value, and you can currently achieve it only by hooking it. (There could be cases where they don't remain visual when hexpatching, but these exceptions are not representing the reality.).
I see :pepe008:

I'm currently messing around with the LGL menu and trying to learn everything I need, so I can then implement the ObscuredInt methods by looking at examples of C++ code for some Obscured type questions here in this forum.

I'll probably have it easy, but a year ago I remember creating a mod menu as a headache :pepe001: