frida/frida-node

[Example] How to read a file from gadget / agent

c128128 opened this issue · 2 comments

Hi there, are there any good examples how to read a file from gadget / agent ? I already tried frida-fs but, I haven't understood how to do it.

Thanks.

Grab frida-agent-example and use the Node.js fs module as if you were targeting Node.js, and frida-compile will plug in the frida-fs shim automatically. This is how you can already use thousands of existing packages from npm whether they're written for Node.js, the web, or Frida.

One tip that might save you some grief: You can use promisify() from Node.js' util module to wrap fs functions so they can be awaited from an async function. That way you won't have to deal with callback spaghetti.

Thanks @oleavr,

Let me clarify my question. I want to transfer files from device to macos, I know I can use something like scp, but I am connected using USB. I mean something like this example.

My first idea was to create a HTTP server on device, and than from local request files that I need, but maybe there are other methods.

P.S: I am new to frida and not really familiar with terminologies.
What I know is that script that will be executed on device is called in most cases agent, but how you call local script ?