Skip to content

Instantly share code, notes, and snippets.

@oleavr

oleavr/hello.c Secret

Last active April 18, 2018 10:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleavr/f911434d61303199fec0 to your computer and use it in GitHub Desktop.
Save oleavr/f911434d61303199fec0 to your computer and use it in GitHub Desktop.
Frida Intro
#include <stdio.h>
#include <unistd.h>
void
f (int n)
{
printf ("Number: %d\n", n);
}
int
main ()
{
int i = 0;
printf ("f() is at %p\n", f);
while (1)
{
f (i++);
sleep (1);
}
}
'use strict';
const co = require('co');
const frida = require('frida');
let session, script;
co(function *() {
session = yield frida.attach('hello');
script = yield session.createScript('(' + agent.toString() + ').call(this);');
yield script.load();
});
function agent() {
'use strict';
Interceptor.attach(ptr('0x106a81ec0'), {
onEnter: function (args) {
args[0] = ptr("1337");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment