Skip to content

hetima/HTSymbolHook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTSymbolHook

HTSymbolHook is Objective-C wrapper of mach_override.
In addítion, It can override symbol by name (even non-exported!).

#Usage Tested on OS X 10.8.5 64bit with ARC.

Symbol name must contain underscore prefix. So use entire name by nm output. (e.g. specify @"_NSClassFromString" not @"NSClassFromString")

HTSymbolHook* hook=[HTSymbolHook symbolHookWithImageNameSuffix:@"/FrameworkName"];
[hook overrideSymbol:@"_symbol_name"
    withPtr:(void*)replace_function
    reentryIsland:(void**)&original_function];

If you check symbol index in advance,

UInt32 correctIndex=[hook indexOfSymbol:@"_symbol_name"];

Then It can be used as needle for speed.

UInt32 seekStartIndex=12345-20;
[hook overrideSymbol:@"_symbol_name"
    withPtr:(void*)replace_function
    reentryIsland:(void**)&original_function
    symbolIndexHint:seekStartIndex];

Author

http://hetima.com/
https://twitter.com/hetima

License

HTSymbolHook
MIT License. Copyright (c) 2013 hetima.

mach_override
(c) 2003-2012 Jonathan 'Wolf' Rentzsch

About

Objective-C wrapper of mach_override

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages