Skip to content

Instantly share code, notes, and snippets.

Created February 21, 2023 06:26
What would you like to do?
Reachable Mach services from the app sandbox on iOS 16.1
NSDictionary<NSString*, id>* dict = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/xpc/launchd.plist"];
NSDictionary<NSString*, id>* launchDaemons = dict[@"LaunchDaemons"];
for (NSString* key in launchDaemons) {
NSDictionary<NSString*, id>* job = launchDaemons[key];
NSDictionary<NSString*, id>* machServices = job[@"MachServices"];
for (NSString* serviceName in machServices) {
mach_port_t service_port = MACH_PORT_NULL;
kern_return_t err = bootstrap_look_up(bootstrap_port, serviceName.UTF8String, &service_port);
if (!err) {
printf("%s\n", serviceName.UTF8String);
mach_port_deallocate(mach_task_self_, service_port);
Copy link

xooxo commented Mar 7, 2023

Hmm, I can't send a message to,though. I'm getting XPC_ERROR_CONNECTION_INVALID from an app with a sandbox set on Mac 13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment