Solved Frida Not Able To Hook Game Functions

Status
Not open for further replies.

tahooo

Platinian
i run frida with genymotion and installed free fire game x86 version and i was able to get base address of libil2cpp.so but when i use the offset to hook the functions i get nothing from frida i tryed with multiple functions and the result is the same this is the code i use :

JavaScript:
console.log("Script loaded successfully ..... ");

function awaitForCondition(callback) {
    var i = setInterval(function () {
      var addr = Module.findBaseAddress('libil2cpp.so');
        console.log("Address found:", addr);
        if (addr) {
            clearInterval(i);
            callback(+addr);
        }
    }, 2);
}

var il2cpp = null;


Java.perform(function () {
    
    
     awaitForCondition(function (base) {
        il2cpp = ptr(base);
        var offset= il2cpp.add(0x8B1824);
    Interceptor.attach(offset, {
    onEnter: function(args) {
        console.log('func called!');
        this.instance = args[0];
        
        },
    onLeave: function(ret_val) {
        console.log('func leave!');
    }
  })
  })
  });
 
i solved this by dumping the right offsets from genymotion by frida tool called "il2cpp-bridge"
and then i was able to intercept the calls to the functions.
for a reason the offsets that i dumbed from game guardian from the memu emulator is not the same.
 
Status
Not open for further replies.
Back
Top Bottom