Skip to content

Instantly share code, notes, and snippets.

@oleavr
Created February 18, 2020 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleavr/c503f4bc07ffd6ba804367d7817e9b3b to your computer and use it in GitHub Desktop.
Save oleavr/c503f4bc07ffd6ba804367d7817e9b3b to your computer and use it in GitHub Desktop.
Frida Hello World
/*
* Try it on a running process like this:
*
* $ frida gimp-2.10 -l hello.js
*
* This uses the Frida REPL, which supports live-reload.
*/
Interceptor.attach(Module.getExportByName(null, 'open'), {
onEnter: function (args) {
var path = args[0].readUtf8String();
console.log('open() path="' + path + '"');
},
onLeave: function (retval) {
var fd = retval.toInt32();
console.log(' => fd=' + fd);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment