doAttach:function (addr) {
Interceptor.attach(addr,{
onEnter:function (args){
let interpMethodInfo = new InterpMethodInfo(args[1]);
let methodInfo = interpMethodInfo.get_methodInfo();
let methodName = methodInfo.name();
let klass = methodInfo.getClass();
let il2CppImage = il2cppApi.il2cpp_class_get_image(klass);
let klassName = klass.name();
let dll = il2CppImage.name();
let namespaze = klass.namespaze();
let flags = methodInfo.getFlags();
let methodStatic = utils.get_method_static(flags);
// console.log("is methodStatic "+methodStatic)
let argCount = interpMethodInfo.get_argCount();
let key;
if (methodStatic){
key = dll + "_" + namespaze + "_" + klassName + "_" + methodName + "_" + argCount;
}else {
key = dll + "_" + namespaze + "_" + klassName + "_" + methodName + "_" + (argCount-1);
}
let callback = observes.get(key);
if (callback){
let argBase= args[2];
let runtimeArgs= [];
for (let i = 0; i < argCount; i++) {
let arg = argBase.add(i*Process.pointerSize);
runtimeArgs.push(arg);
}
callback(interpMethodInfo,runtimeArgs);
}
}
})
}