Skip to content

Instantly share code, notes, and snippets.

@dlevi309
dlevi309 / libicucore_shim.c
Last active February 19, 2026 18:57
Compatibility shim for tools that export `ubrk_clone` (libicucore.A.dylib)
// Fix for dyld[8734]: Symbol not found: _ubrk_clone
// more info: https://github.com/oven-sh/bun/issues/6035
// cc -shared main.c -o libicucore_shim.dylib -Wl,-reexport-licucore -current_version 1.0.0 -compatibility_version 1.0.0
// install_name_tool -change /usr/lib/libicucore.A.dylib /usr/local/lib/libicucore_shim.dylib target_binary
#include <stdlib.h>
#include <stdint.h>
typedef struct UBreakIterator UBreakIterator;
@dlevi309
dlevi309 / cleartheboard.m
Created February 4, 2026 12:24
Kills all processes managed by runningboardd (works on macOS / iOS)
// cc -o cleartheboard src/main.m -framework Foundation -F /System/Library/PrivateFrameworks/ -framework RunningBoardServices
// sign with com.apple.runningboard.terminatemanagedprocesses
#import <Foundation/Foundation.h>
@interface RBSTerminateRequest : NSObject
- (instancetype)initForAllManagedWithReason:(NSString *)reason;
- (BOOL)execute:(NSError **)error;
@end
@dlevi309
dlevi309 / FastPathEnts.xml
Last active September 5, 2025 01:50 — forked from khanhduytran0/ProcursusTSHelper.c
ProcursusTSHelper.c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.security.no-container</key>
<true/>
<key>get-task-allow</key>
<true/>
<key>platform-application</key>
<true/>
@import Darwin;
@import Foundation;
@import MachO;
#import <mach-o/fixup-chains.h>
// you'll need helpers.m from Ian Beer's write_no_write and vm_unaligned_copy_switch_race.m from
// WDBFontOverwrite
// Also, set an NSAppleMusicUsageDescription in Info.plist (can be anything)
// Please don't call this code on iOS 14 or below
// (This temporarily overwrites tccd, and on iOS 14 and above changes do not revert on reboot)
@dlevi309
dlevi309 / objc_description.m
Created May 21, 2024 01:43
Dumps Objective-C class/instance info at runtime
//
// MIT License
//
// Copyright (c) 2024 Derek Selander
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@dlevi309
dlevi309 / 0strings.md
Last active October 8, 2023 19:23
a version of `strings(1)` that isn’t dependent on a linker

strings

a version of strings(1) that isn’t dependent on a linker. Dumps all strings of any given file.

Based off code provided by toybox

@dlevi309
dlevi309 / reachable_services_get.m
Last active March 3, 2025 23:31 — forked from zhuowei/reachable_services.txt
Reachable Mach services from the app sandbox on iOS 16.1
// cc reachable_services_get.m -o reachable_services_get -framework Foundation
#import <Foundation/Foundation.h>
#import <servers/bootstrap.h>
void enumerateMachServices() {
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];
/*
* Copyright (C) 2023 Daniel Levi
*
* Alternate version
*
*/
#pragma once
#include <CoreFoundation/CoreFoundation.h>
@dlevi309
dlevi309 / platform_swap.m
Last active October 9, 2023 08:00
Exchange Mach-O platform types with min version
//
// main.m
// platform_swap @LOLgrep
//
#import <Foundation/Foundation.h>
#import <mach-o/loader.h>
#define PLATFORM_VISIONOS 11
#define PLATFORM_VISIONOSSIMULATOR 12
@dlevi309
dlevi309 / crashcatch.c
Last active January 1, 2024 09:30
Interpose-able code to catch crashes, print, and exit cleanly. Check near line 106 https://opensource.apple.com/source/libclosure/libclosure-67/objectTests/test.pl
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
// from dyld-interposing.h
#define DYLD_INTERPOSE(_replacement,_replacee) __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };