Last active
June 9, 2016 23:19
-
-
Save oleavr/65ce4381b63100588bdd to your computer and use it in GitHub Desktop.
Interceptor context example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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