Last active
December 9, 2021 02:10
-
-
Save stek29/ccbe7a122c2f8f13fe1b713a8776708b to your computer and use it in GitHub Desktop.
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
#include <objc/runtime.h> | |
extern void *SubGetImageByName(const char *filename) __asm__("SubGetImageByName");; | |
void *MSGetImageByName(const char *filename) { | |
return SubGetImageByName(filename); | |
} | |
extern void *SubFindSymbol(void *image, const char *name) __asm__("SubFindSymbol"); | |
void *MSFindSymbol(void *image, const char *name) { | |
return SubFindSymbol(image, name); | |
} | |
extern void SubHookFunction(void *symbol, void *replace, void **result) __asm__("SubHookFunction"); | |
void MSHookFunction(void *symbol, void *replace, void **result) { | |
SubHookFunction(symbol, replace, result); | |
} | |
extern void SubHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result) __asm__("SubHookMessageEx"); | |
void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result) { | |
SubHookMessageEx(_class, sel, imp, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to build shim:
xcrun -sdk iphoneos cc -dynamiclib -arch arm64 substrate-shim.c -L$PWD -lsubstitute -install_name /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate -o CydiaSubstrate
jtool --sign --inplace CydiaSubstrate
or ldid or ldid2 or whatevermkdir -p /Library/Frameworks/CydiaSubstrate.framework
/Library/Frameworks/CydiaSubstrate.framework
/Library/MobileSubstrate/DynamicLibraries
to/bootstrap/Library/SBInject
ofc (no need to mess with install_name_tool though)You can just make a symlink from
/Library/MobileSubstrate/DynamicLibraries
to/bootstrap/Library/SBInject
.