Skip to content

Instantly share code, notes, and snippets.

@dangthaison91
dangthaison91 / HookUIApplicationMain.m
Created July 25, 2022 11:10 — forked from NSExceptional/HookUIApplicationMain.m
Hooking UIApplicationMain in Swift or Objc apps with Fishhook
// UIApplicationMain accepts Swift.String in Swift apps; a C forward declaration is needed
struct SwiftString {
uint8_t reserved[16];
};
typedef struct SwiftString SwiftString;
int (*orig_UIApplicationMain_objc)(int argc, char *argv[], NSString *_, NSString *delegateClassName) = nil;
int (*orig_UIApplicationMain_swift)(int argc, char *argv[], SwiftString _, SwiftString delegateClassName) = nil;
NSString *(*FoundationBridgeSwiftStringToObjC)(SwiftString str) = nil;