Skip to content

Instantly share code, notes, and snippets.

@oleavr
Last active June 9, 2016 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save oleavr/65ce4381b63100588bdd to your computer and use it in GitHub Desktop.
Save oleavr/65ce4381b63100588bdd to your computer and use it in GitHub Desktop.
Interceptor context example
'use strict';
Module.enumerateExports('libssl.so', {
onMatch(e) {
if (e.type === 'function')
Interceptor.attach(e.address, createHook(e.name, e.address));
},
onComplete() {
}
});
function createHook(name, address) {
return {
onEnter(args) {
// You can access `name` and `address` here
},
onLeave(retval) {
// and here
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment