Skip to content

Commit

Permalink
Log dylib load error message on fail
Browse files Browse the repository at this point in the history
  • Loading branch information
aydenp committed Oct 31, 2019
1 parent 03d3919 commit e14c33b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simject/simject.xm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ NSArray *simjectGenerateDylibList() {
blackListForFLEX = @[@"com.apple.Search.framework", @"com.apple.accessibility.AccessibilityUIServer", @"com.apple.backboardd"];
// Inject any dylib meant to be run for this application
for (NSString *dylib in simjectGenerateDylibList()) {
HBLogDebug(@"Injecting %@ into %@: %d", dylib, NSBundle.mainBundle.bundleIdentifier, dlopen([dylib UTF8String], RTLD_LAZY | RTLD_GLOBAL) != NULL);
BOOL success = dlopen([dylib UTF8String], RTLD_LAZY | RTLD_GLOBAL) != NULL;
HBLogDebug(@"Injecting %@ into %@: %d.", dylib, NSBundle.mainBundle.bundleIdentifier, success);
if (!success) HBLogError(@"Couldn't inject %@ into %@:\n%s.", dylib, NSBundle.mainBundle.bundleIdentifier, dlerror());
}
}

0 comments on commit e14c33b

Please sign in to comment.