-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'this' value of incorrect type #237
Comments
Interceptor.attach(getRandomSeedID.virtualAddress, {
onEnter(args) {
console.log(args[0]);
console.log(args[1]);
console.log(args[2]);
const min = new Il2Cpp.String(args[1]);
const max = new Il2Cpp.String(args[2]);
console.log(min);
console.log(max);
}
});
At the moment I'm able to just change |
Thanks for the report. Would you try an older Frida version ( |
Can confirm same issue.
|
Unfortunately the game won't load because it requires the google play services, which I don't have. console.log(typeof this);
console.log(this instanceof Il2Cpp.Object);
if (this instanceof Il2Cpp.Object) {
console.log(this.class.type.name);
} |
Thank you for trying to run the APK.
As expected by the pointers... 🤔 |
There are two possibilities: |
So I would go for: const dummySeed = assem.class("Seed").alloc();
getRandomSeedID.implementation = function (min : Il2Cpp.String, max: Il2Cpp.String) : Il2Cpp.Object {
return dummySeed.method<Il2Cpp.Object>("GetRandomSeedID").invoke(max, max);;
}; |
Yes, that works as expected. I am not able to cache the allocated class because sometimes it gets overriden by other classes and fails randomly with errors like:
Thank you for walking me through the debugging. Hopefully this issue will help somebody in the future like the rest of issues helped me to learn the library 👍🏿 |
Right! That occurs because You could try: let dummySeed: Il2Cpp.Object?;
getRandomSeedID.implementation = function (min : Il2Cpp.String, max: Il2Cpp.String) : Il2Cpp.Object {
if (dummySeed == null) dummySeed = assem.class("Seed").alloc();
return dummySeed!.method<Il2Cpp.Object>("GetRandomSeedID").invoke(max, max);;
}; or const dummySeed = assem.class("Seed").alloc();
dummySeed.ref(true);
getRandomSeedID.implementation = function (min : Il2Cpp.String, max: Il2Cpp.String) : Il2Cpp.Object {
return dummySeed.method<Il2Cpp.Object>("GetRandomSeedID").invoke(max, max);;
}; I am curious to know if both works! |
Probably related to #181.
UnityVersion: 2020.3.34f1
APK: [REDACTED]
Frida version: latest (16.0.1)
Frida server: latest (16.0.1) arm64
Compiled with:
esbuild --bundle --outfile=_.js --watch index.ts
Running on: real hardware
getRandomSeedID.fridaSignature
Any indications on how to keep troubleshooting or any extra information that I can gather to help debug the issue?
Thank you for your time and work on the library. Much appreciated.
The text was updated successfully, but these errors were encountered: