Created
June 23, 2017 18:52
-
-
Save jrsa/ad1674687fdff972e9d85c6429af656a to your computer and use it in GitHub Desktop.
demonstration of function hooking inside world of warcraft, using cycript (http://www.cycript.org/)
This file contains 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
var log = []; | |
var oldf = {}; // this object is used to access the original function from the hook | |
// address of smemalloc taken from: | |
// wow build 12340, macOS i386 build, md5: 1abfcf2cb17cdbe804c1c77d0525f1fa | |
var smemalloc = @encode(void*(int, char*, int, int))(0x9bad0) | |
var hook = function(a1, file, a3, a4) { | |
var ptr = (*oldf)(a1, file, a3, a4); | |
log.push([a1, file.toString(), a3, a4]); | |
return ptr; | |
} | |
MS.hookFunction(smemalloc, hook, oldf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example log contents: https://gist.github.com/jrsa/cf31f1aa35f62d009760480bc295321f