Help! How Modif a GET/SET Obscured in ARMv7/ARM64v8

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
Hello community,

Let me introduce myself, I have been registered for quite some time on your forum, and all your tutorials have allowed me to make good progress.

I'm not an experienced modder but I manage.

I need brains to understand or put into practice certain things, at least in part.

Let me explain, right now I'm mode a game that is in ARMv7 and ARM64v8 version, this game contains several protections and a well-known anti cheat (ACTK) codestage.

On the ARMv7 version, no problem, I modify the obscured values directly via functions internal to the codestage, and for the fields, I use the unity.h from shmoo.

So I come to my problem, when I want to mod the game in ARM64v8, nothing works anymore for the obscured values, yet it's exactly the same code. I do not understand anything.

So if a more experienced modder could guide me so that I can modify a simple get_

I would like to return an obscured value with this method:


C++:
// Hook Method
int (*old_CoinMod)(void *instance);
int CoinMod(void *instance)
{
    if(instance != nullptr)
    {
        if(HackCoin) // Toggle
        {

            // COIN
            /// => I need to return a obscuredint value
           
            // Tried with UnityStuff ( not work) because work just for field
            SetObscuredIntValue( instance, 999);
        }

    }
    return old_CoinMod(instance);
}

// Hook
// public static ObscuredInt get_Coin
A64HookFunction((void*)getAbsoluteAddress(targetLibName, DataManager::get_Coin) , (void*)CoinMod, (void**)&old_CoinMod);
And when I want to use the internal method, which however works on the ARMv7 version, I have an error message in the LOGCAT:


Code:
NullReferenceException: Object reference not set to an instance of an object.
      at CodeStage.AntiCheat.ObscuredTypes.ObscuredInt.InternalDecrypt () [0x00000] in <00000000000000000000000000000000>:0
If anyone has a method, please give me a boost, or if they have a formidable one, but don't want to share it, I'm a taker even by private message

thanks in advance. :face33:
 

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
Show the method from dnSpy?
C#:
public static ObscuredInt Coin
    {
        [Token(Token = "0x6003528")]
        [Address(RVA = "0x26C5238", Offset = "0x26C5238", VA = "0x26C5238")]
        get
        {
            return default(ObscuredInt);
        }
    }
 

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
I already tried with static but it doesn't work for me either

on ARMv7 it work perfect for me, but not on ARM64, why i dont know, because for BoolObscured, not problem, but for Int, not work
 

derzost2

Platinian
Apr 15, 2022
17
3
3
31
RU
on ARMv7 it work perfect for me, but not on ARM64, why i dont know, because for BoolObscured, not problem, but for Int, not work
I faced the same problem, did you manage to solve it somehow?
Maybe it will help you
 
Last edited:

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
I faced the same problem, did you manage to solve it somehow?
Maybe it will help you

thnaks, i hve checked your problem, but mine is not the same, i use LGL mod menu, with A64hook, the menu correctly find the library, my problem is my hook function for armV7 is exactly same for Arm64 , excepted certain field (it changed on ARM64)

So or all hook + codestagebypass + hook obscuredtype on armv7 work fine !!!
=> in ARM 64, all normal hook, bypass codestage and obscured Bool work fine, just obscuredint not work, because bloked by internaldecrypt(), i dont know why , it same xactly same native function in armv7 and arm64.

i search but idk :face02:
 

derzost2

Platinian
Apr 15, 2022
17
3
3
31
RU
C#:
public static ObscuredInt Coin
    {
        [Token(Token = "0x6003528")]
        [Address(RVA = "0x26C5238", Offset = "0x26C5238", VA = "0x26C5238")]
        get
        {
            return default(ObscuredInt);
        }
    }
I missed that you have a static method, everything is simple, there is no instance in static methods, so skip the first argument
Try like this
C++:
// Hook Method
static int (*old_CoinMod)();
static int CoinMod()
{
    if(HackCoin) // Toggle
    {
        //SetObscuredIntValue( instance, 999); //Set static??
        SetObscuredIntValue(999); //I think that the set is also static

    }
    return old_CoinMod();
}

// Hook
// public static ObscuredInt get_Coin
A64HookFunction((void*)getAbsoluteAddress(targetLibName, DataManager::get_Coin) , (void*)CoinMod, (void**)&old_CoinMod);
I already tried with static but it doesn't work for me either
Info from another programming language, but the essence is the same
1670115988255.png
 
Last edited:
  • Like
Reactions: ziz59

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
I missed that you have a static method, everything is simple, there is no instance in static methods, so skip the first argument
Try like this
C++:
// Hook Method
static int (*old_CoinMod)();
static int CoinMod()
{
    if(HackCoin) // Toggle
    {
        //SetObscuredIntValue( instance, 999); //Set static??
        SetObscuredIntValue(999); //I think that the set is also static

    }
    return old_CoinMod();
}

// Hook
// public static ObscuredInt get_Coin
A64HookFunction((void*)getAbsoluteAddress(targetLibName, DataManager::get_Coin) , (void*)CoinMod, (void**)&old_CoinMod);

Info from another programming language, but the essence is the same
View attachment 475876
I will test :)
 

ziz59

Approved Modder
Original poster
Approved Modder
Nov 7, 2020
122
2,174
193
43
fr
I missed that you have a static method, everything is simple, there is no instance in static methods, so skip the first argument
Try like this
C++:
// Hook Method
static int (*old_CoinMod)();
static int CoinMod()
{
    if(HackCoin) // Toggle
    {
        //SetObscuredIntValue( instance, 999); //Set static??
        SetObscuredIntValue(999); //I think that the set is also static

    }
    return old_CoinMod();
}

// Hook
// public static ObscuredInt get_Coin
A64HookFunction((void*)getAbsoluteAddress(targetLibName, DataManager::get_Coin) , (void*)CoinMod, (void**)&old_CoinMod);

Info from another programming language, but the essence is the same
View attachment 475876
tested not work, same problem for "
NullReferenceException: Object reference not set to an instance of an object.
at CodeStage.AntiCheat.ObscuredTypes.ObscuredInt.InternalDecrypt () [0x00000] in <00000000000000000000000000000000>:0
"
 

derzost2

Platinian
Apr 15, 2022
17
3
3
31
RU
tested not work, same problem for "
NullReferenceException: Object reference not set to an instance of an object.
at CodeStage.AntiCheat.ObscuredTypes.ObscuredInt.InternalDecrypt () [0x00000] in <00000000000000000000000000000000>:0
"
u can show dump?
try this
C++:
// Hook Method
static void* (*old_CoinMod)();
static void* CoinMod()
{
    if(HackCoin) // Toggle
    {
        //SetObscuredIntValue( instance, 999); //Set static??
        SetObscuredIntValue(999); //I think that the set is also static

    }
    return old_CoinMod();
}

// Hook
// public static ObscuredInt get_Coin
A64HookFunction((void*)getAbsoluteAddress(targetLibName, DataManager::get_Coin) , (void*)CoinMod, (void**)&old_CoinMod);
 

pentarix1996

Platinian
Dec 31, 2023
13
1
1
22
Good night. I wanted to take the opportunity to ask a question I have about ARMv7 and ARM64v8.

When working with hexadecimal data, how is it calculated?

For example, I found this value in C# on ARMv7 and ARM64. But I don't understand how they obtained those values, if for example I want to obtain 0l or 1l (for boolean values)

Code:
C#:
return 99l;

ARMv7:

63 00 A0 E3 00 10 A0 E3 1E FF 2F E1

ARM64:

60 0C 80 52 C0 03 5F D6
 

nekrasov

Platinian
Dec 16, 2022
9
1
3
Behind You
Good night. I wanted to take the opportunity to ask a question I have about ARMv7 and ARM64v8.

When working with hexadecimal data, how is it calculated?

For example, I found this value in C# on ARMv7 and ARM64. But I don't understand how they obtained those values, if for example I want to obtain 0l or 1l (for boolean values)

Code:
C#:
return 99l;

ARMv7:

63 00 A0 E3 00 10 A0 E3 1E FF 2F E1

ARM64:

60 0C 80 52 C0 03 5F D6
Good guestion, as far as I know not the all values can be in short ARMV7 form.

You can get ARM codes here: Best ARM Converter