Jump to content
  • 0

How to hook a method parameter via game guardian


harpov
 Share

Question

Hi! Can you tell me how to hook a parameter of this method through game guardian. (il2cpp.so) I will be grateful for your help

below is an example of my method

[Token(Token = "0x60014AD")]
    [Address(RVA = "0xAFA720", Offset = "0xAFA720", VA = "0xAFA720")]
    public static Sprite getFrame(string id = "")
    {
        return null;
    }

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @harpov, you're trying to pass a string as parameter. It is kind of difficult in Game Guardian, since it can only replace existing memory. String is handled as pointer, when function asking for string types, it is asking the pointer of the string not the string itself. It is because string can consist more than one character, which there will be several hex/bytes representing each character. You might want to read this: ARM Patching

Quote

    public static Sprite getFrame(string id = "")
    {
        return null;
    }

I've seen that you're only trying to make it return null. First, you need to check wether the function is void or returning something. If you're intending to disable the function just do:

BX LR
1E FF 2F E1

If it's void, disabling the function can crash the game. Alternatively you can pass one character to the parameter. You can try to convert character to hex: UTF8 to Hex. For example, character 'a' is '0x61' in hex. So you can do something like this:

MOV R1, 0x61
61 10 A0 E3

Note that you need to adjust the 'R1' or the register according to the parameter. First parameter is usually passed into R1 register, but since it is a string, you might looking for LDR/LDRB instruction inside the function and change it with the instruction above.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.