Skip to content
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

frida-fs createReadStream: on('end') is never called #2447

Open
jpstotz opened this issue Mar 10, 2023 · 0 comments
Open

frida-fs createReadStream: on('end') is never called #2447

jpstotz opened this issue Mar 10, 2023 · 0 comments

Comments

@jpstotz
Copy link

jpstotz commented Mar 10, 2023

I use the frida-agent-example project using the following code as agent/index.ts:

import { createReadStream } from "fs";

function readFile() {
    const filename = "/Applications/MobileSafari.app/MobileSafari";
    console.log("reading " + filename);
    const stream = createReadStream(filename);
    stream.on('data', (chunk : ArrayBuffer) => {
      console.log("data length: " + chunk.byteLength);
    })
    .on('end', () => {
      console.log("FINISHED");
    })
    .on('error', () => {
      console.log("ERROR");
    });
}

readFile();
> npm run build
> frida -U springboard -l _agent.js
     ____
    / _  |   Frida 16.0.10 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
   . . . .
   . . . .   Connected to Apple iPhone (id=XXXXX)
Attaching...
reading /Applications/MobileSafari.app/MobileSafari
[Apple iPhone::springboard ]-> data length: 2766864
[Apple iPhone::springboard ]->
[Apple iPhone::springboard ]-> exit

As you can see on('end') and thus console.log("FINISHED") is never called.
Another problem is that if you execute exit in frida nothing happens. Frida continues to run.

frida-server on the device is also v16.0.10 from Frida Cydia repository.
The used phone is an iPhone XR running iOS 14.2 with Unc0ver jailbreak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant