vfsfitvnm / frida-il2cpp-bridge

A Frida module to dump, trace or hijack any Il2Cpp application at runtime, without needing the global-metadata.dat file.

Home Page:https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game can't be dump

thienha1 opened this issue · comments

Capture
I dont know this happen for now, old version of this game work normal! Maybe they obfuscated all name?

Source code:

Il2Cpp.perform(() => {
  // console.log(Il2Cpp.unityVersion);
    Il2Cpp.dump("hsrsea.cs");
});

mihoyo games have modified il2cpp binaries and hidden exports. thats why it don't work with common il2cpp tools

"No such file or directory" means it couldn't create the file where to write the dump, pass the directory as the second parameter:

export function dump(fileName?: string, path?: string): void {

(and make sure it exists!)

hmm ik that genshin (mobile version, idk about pc) have protections like hidden exports, encrypted metadata, etc... maybe hsr still not

"No such file or directory" means it couldn't create the file where to write the dump, pass the directory as the second parameter:

export function dump(fileName?: string, path?: string): void {

(and make sure it exists!)

I created this file
Capture

And still got this error
Capture
Code:

Il2Cpp.perform(() => {
  // console.log(Il2Cpp.unityVersion);
    Il2Cpp.dump("hsrsea.cs", "D:\APKLabs\Dumped Honkai Star Rail SEA");
}, "free");

hmm ik that genshin (mobile version, idk about pc) have protections like hidden exports, encrypted metadata, etc... maybe hsr still not

yeah mihoyo did that but still i dunno how modder could dump those encrypted file in PC... What tools they use?

idk sorry, you can try explore cheats for these games (akebi source available only for 3.2, i seen some hsr cheat). maybe it will help u

@thienha1
Oh yeah I think I know what's wrong (I don't have Windows so I can't really test...).

Here's how I generate the full path:

const destination = `${path ?? Il2Cpp.application.dataPath}/${fileName}`;

But as you can see, I use the Unix file separator char (/) - illegal on Windows - instead of the correct one (\).

Would you patch either your local copy (node_modules/frida-il2cpp-bridge/dist/index.js) or the bundled script (_agent.js) and see if it works?

@thienha1 Oh yeah I think I know what's wrong (I don't have Windows so I can't really test...).

Here's how I generate the full path:

const destination = `${path ?? Il2Cpp.application.dataPath}/${fileName}`;

But as you can see, I use the Unix file separator char (/) - illegal on Windows - instead of the correct one (\).

Would you patch either your local copy (node_modules/frida-il2cpp-bridge/dist/index.js) or the bundled script (_agent.js) and see if it works?

I updated your script to latest version
Capture
But I tried this function dump without parameter 2 before of this game in old version, it work smoothly! Now I tried all of this with latest version for now, not work at all!

@thienha1
Hmm, this is weird to be honest.
However, just to make sure, would you replace the / with \ at line 648?
And then:

Il2Cpp.perform(() => {
    Il2Cpp.dump("hsrsea.cs", "D:\APKLabs\Dumped Honkai Star Rail SEA");
}, "free");

Another possibility is the app cannot write to that path, but again, I have no idea how it works on Windows; does the following Frida script works?

const file = new File("D:\APKLabs\Dumped Honkai Star Rail SEA\hello.cs", "w");
file.write("hello!");
file.flush();
file.close();

And, shouldn't it be: D:\\<and so on>? Notice the double backslash

And, shouldn't it be: D:\\<and so on>? Notice the double backslash

Yeah, it temp working and get other issue...
Capture

You need to determine the Unity version by yourself (it doesn't have to be precise, though), then. Unfortunately I don't have Windows so I cannot find a workaround by myself.

Then, see #96 (comment)