shadowtech 发表于 2024-6-15 22:53

frida-il2cpp-bridges调试时遇到的奇怪的问题

本帖最后由 shadowtech 于 2024-6-15 22:55 编辑

import "frida-il2cpp-bridge";

Il2Cpp.perform(() => {
    const AssembleCSharp = Il2Cpp.domain.assembly("hall_xy").image;
    const HybridCLRRuntimeManager = AssembleCSharp.class('HybridCLRRuntimeManager');

    const Load = HybridCLRRuntimeManager.method('LoadDll');

    Load.implementation = function (hotFixFileName: Il2Cpp.String, target: Il2Cpp.Method) {
      console.log(`LoadDll called with argument: ${hotFixFileName}`);

      const result = this.method('LoadDll').invoke(hotFixFileName, target);

      console.log(`LoadDll returned: ${result}`);

      return result;
    }
});

明明上下调用的都是同一个方法,我打印也是没问题的,但实际在const result = 这个位置,我调用Invoke就报错了,求大佬解答。


报错信息:


il2cpp: couldn't find method LoadDll in class System.String
    at method (il2cpp/structs/class.ts:269)
    at method (il2cpp/structs/object.ts:38)
    at <anonymous> (index.ts:12)
    at call (native)
    at <anonymous> (il2cpp/structs/method.ts:334)



mq5123 发表于 2024-7-6 13:20

this识别为class System.String 并不是 HybridCLRRuntimeManager,具体原因不明

alongsoft2020 发表于 2024-7-26 01:34

const YourMethod: Il2Cpp.Method = ...略;
YourMethod.implementation = function (...args) {
    if (YourMethod.class.isAssignableFrom((this as Il2Cpp.Object).class)) {
      // your code here
    } else {
      return (YourMethod as any).invokeRaw(this, ...args);
    }
};
页: [1]
查看完整版本: frida-il2cpp-bridges调试时遇到的奇怪的问题