Skip to content

Instantly share code, notes, and snippets.

View MeBlackHat's full-sized avatar
😀
Building iOS tweaks..

Mr-BlackHat MeBlackHat

😀
Building iOS tweaks..
View GitHub Profile
@menushka
menushka / hookAllMethods.sh
Last active April 23, 2021 11:58
Convert Objective C header file to Logos tweak file with all methods hooked and logged with option to log return value also
#!/bin/sh
getStringFormat() {
SED_REPALCE[0]='s/HBLogDebug(id)/HBLogDebug(@"Returns: %@", r)/g; '
SED_REPALCE[1]='s/HBLogDebug(int)/HBLogDebug(@"Returns: %d", r)/g; '
SED_REPALCE[2]='s/HBLogDebug(unsigned int)/HBLogDebug(@"Returns: %u", r)/g; '
SED_REPALCE[3]='s/HBLogDebug(double)/HBLogDebug(@"Returns: %f", r)/g; '
SED_REPALCE[4]='s/HBLogDebug(unsigned char)/HBLogDebug(@"Returns: %c", r)/g; '
SED_REPALCE[5]='s/HBLogDebug(unichar)/HBLogDebug(@"Returns: %C", r)/g; '
SED_REPALCE[6]='s/HBLogDebug(long long)/HBLogDebug(@"Returns: %lld", r)/g; '
SED_REPALCE[7]='s/HBLogDebug(BOOL)/HBLogDebug(@"Returns: %@", r ? @"YES" : @"NO")/g; '