vfsfitvnm / frida-il2cpp-bridge

A Frida module to dump, trace or hijack any Il2Cpp application at runtime, without needing the global-metadata.dat file.
https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki
MIT License
974 stars 199 forks source link

Is there something wrong with the hook dlopen #255

Closed 350030173 closed 1 year ago

350030173 commented 1 year ago

i use frida-gadget

my code:

function myfun() 
{
    Il2Cpp.perform(() =>
    {
        var HealthManager = Il2Cpp.Domain.assembly("Assembly-CSharp").image.class("HealthManager");
        HealthManager.method("ConsumKi").implementation = function (kiAmount)
        {
            util.log("ConsumKi:" + kiAmount);
            if (kiAmount > 0)
            {
                kiAmount = -kiAmount;
            }
            var ret = this.method("ConsumKi").invoke(kiAmount);
            return ret;
        };
    });
}

**setTimeout(myfun, 3000);//This will work properly**
//setImmediate(myfun);//This will give an error, The error is as follows
2023-02-07 15:45:28.390 4079-4373/? E/ActivityManagerWrapper: getRecentTasks: taskId=2041   userId=0   baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.Highland.SuperSaiyanLegend/com.unity3d.player.UnityPlayerActivity }
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG: Cmdline: com.Highland.SuperSaiyanLegend
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG: pid: 15863, tid: 15863, name: perSaiyanLegend  >>> com.Highland.SuperSaiyanLegend <<<
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG:       #01 pc 0000000000000c44  /data/app/~~Oz3Vp6ppZ3GWaK2Yrsz0QQ==/com.Highland.SuperSaiyanLegend-Ct_HpaqMTwO-35Ev5NPQUA==/lib/arm64/libmain.so (BuildId: 5d72a1067b4a5a628bb6b87ff0773e89f0b5a812)
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG:       #02 pc 0000000000000a94  /data/app/~~Oz3Vp6ppZ3GWaK2Yrsz0QQ==/com.Highland.SuperSaiyanLegend-Ct_HpaqMTwO-35Ev5NPQUA==/lib/arm64/libmain.so (BuildId: 5d72a1067b4a5a628bb6b87ff0773e89f0b5a812)
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG:       #05 pc 000000000005dc34  /data/app/~~Oz3Vp6ppZ3GWaK2Yrsz0QQ==/com.Highland.SuperSaiyanLegend-Ct_HpaqMTwO-35Ev5NPQUA==/oat/arm64/base.vdex
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG:       #07 pc 000000000005d260  /data/app/~~Oz3Vp6ppZ3GWaK2Yrsz0QQ==/com.Highland.SuperSaiyanLegend-Ct_HpaqMTwO-35Ev5NPQUA==/oat/arm64/base.vdex
2023-02-07 15:45:28.644 15903-15903/? A/DEBUG:       #09 pc 000000000005ef8c  /data/app/~~Oz3Vp6ppZ3GWaK2Yrsz0QQ==/com.Highland.SuperSaiyanLegend-Ct_HpaqMTwO-35Ev5NPQUA==/oat/arm64/base.vdex
2023-02-07 15:46:28.525 4079-4373/? E/ActivityManagerWrapper: getRecentTasks: taskId=2041   userId=0   baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 

QQ截图20230207155046

vfsfitvnm commented 1 year ago

Duplicate of https://github.com/vfsfitvnm/frida-il2cpp-bridge/issues/185 (let's continue the discussion there instead)

vfsfitvnm commented 1 year ago

@350030173 However, what's the Android version?

350030173 commented 1 year ago

@350030173 However, what's the Android version?

device: xiaomi 12 Android version: 12