Skip to content

Instantly share code, notes, and snippets.

@wh1te4ever
Last active April 7, 2025 05:30
Show Gist options
  • Save wh1te4ever/c7909dcb5b66c13a217b49ea3e320caf to your computer and use it in GitHub Desktop.
Save wh1te4ever/c7909dcb5b66c13a217b49ea3e320caf to your computer and use it in GitHub Desktop.
TrollStore Detector
//
// ViewController.m
// JBDetectTest
//
// Created by seo on 3/27/25.
//
#import "ViewController.h"
#import <dlfcn.h>
int SBSLaunchApplicationWithIdentifierAndURLAndLaunchOptions(NSString *bundleIdentifier, NSURL *url, NSDictionary *appOptions, NSDictionary *launchOptions, BOOL suspended) {
void *sbs_lib = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", RTLD_NOW);
void *sbs_addr = dlsym(sbs_lib, "SBSLaunchApplicationWithIdentifierAndURLAndLaunchOptions");
typedef int (*sb_func_t)(NSString *, NSURL *, NSDictionary *, NSDictionary *, BOOL);
sb_func_t func = (sb_func_t) sbs_addr;
return func(bundleIdentifier, url, appOptions, launchOptions, suspended);
}
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
int r = SBSLaunchApplicationWithIdentifierAndURLAndLaunchOptions(@"com.opa334.TrollStore", nil, nil, nil, false);
bool isExist = r == 9 ? true : false;
NSLog(@"Is TrollStore Exist? %d\n", isExist);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment