Skip to content

Instantly share code, notes, and snippets.

View semaphore's full-sized avatar
🏠
Working from home... always.

semaphore semaphore

🏠
Working from home... always.
View GitHub Profile
@semaphore
semaphore / MBAutoHook.h
Created March 23, 2019 11:42 — forked from mikaelbo/MBAutoHook.h
Simple Objective-C Method Hooking
@protocol MBAutoHook <NSObject>
@required
+ (NSArray <NSString *> *)targetClasses;
@end
static void __debug(const char* fname, const char* format, ...)
{
fprintf(stderr, "DEBUG: %s", fname);
va_list args;
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
}
#define debug(format, ...) __debug(__func__, format, ##__VA_ARGS__)