Skip to content

Instantly share code, notes, and snippets.

View EthanArbuckle's full-sized avatar
👋

objc EthanArbuckle

👋
View GitHub Profile
@EthanArbuckle
EthanArbuckle / main.m
Created February 13, 2025 08:41
wallpaperwtf
`<PBUIPosterWallpaperRemoteViewController: 0xbc60e6600> {
activeVariant = home;
scaleAssertions = {
<PBUIWallpaperScaleAssertion: 0x301702530; variant: home; scale: 1.000000>;
}
viewController = <PBUIPosterWallpaperViewController: 0xbc606ea00> {
posterController = <PBUIPosterViewController: 0xbc70a8600> {
activelyRequired = NO;
activeStyle = Normal;
activeVariant = home;
@EthanArbuckle
EthanArbuckle / FeatureFlags
Created February 13, 2025 07:51
iOS FeatureFlags (not just the enabled ones found on-disk)
Domain Feature Enabled States
===================================================================
APS SyncXPC YES resolved=enabled
WatchKADelayOOS YES resolved=enabled
SingleInterfaceFilterOptimization YES resolved=enabled
ShorterConnectDelayV1 YES resolved=enabled
SingleInterfaceFilterOptimizationProxy YES resolved=enabled
AVConference EnableNetworkConditionMonitoring YES resolved=enabled
UseTransportStreamsForNW YES resolved=enabled
UPlusNDowngrade YES resolved=enabled
@EthanArbuckle
EthanArbuckle / sim_dylib_loader.m
Created February 2, 2025 01:12
Make Music.app run in iOS Simulator
//
// sim_dylib_loader.m
// objsee
//
// Created by Ethan Arbuckle on 1/31/25.
//
#include <Foundation/Foundation.h>
#include <objc/runtime.h>
#include <dlfcn.h>
@EthanArbuckle
EthanArbuckle / image_size.m
Created January 26, 2025 02:14
get size of a loaded image
uint64_t get_image_size(struct mach_header_64 *mh) {
struct load_command *cmd = (struct load_command *)((uint8_t *)mh + sizeof(struct mach_header_64));
uint64_t max_addr = 0;
for (uint32_t i = 0; i < mh->ncmds; i++) {
if (cmd->cmd == LC_SEGMENT_64) {
struct segment_command_64 *seg = (struct segment_command_64 *)cmd;
uint64_t seg_end = seg->vmaddr + seg->vmsize;
if (seg_end > max_addr) {
max_addr = seg_end;
}
@EthanArbuckle
EthanArbuckle / patchfind.m
Last active March 19, 2025 15:24
find function by string xref
/*
Found string at address: 0x1048aa84d
Found reference in function: hidden_function
Found function that references string: 0x1048a89ec
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import <mach-o/loader.h>
#include <mach-o/dyld.h>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#include <mach-o/dyld_images.h>
#include <dlfcn.h>
static void *dyld_for_each_installed_shared_cache;
static void *dyld_shared_cache_for_each_image;
static void *dyld_image_get_installname;
@EthanArbuckle
EthanArbuckle / main.m
Created January 8, 2025 23:22
set and catch breakpoints
//
// main.m
// breakpoints
//
// Created by @objc on 5/01/23.
//
#import <Foundation/Foundation.h>
#include <mach/mach.h>
#include <pthread.h>
@EthanArbuckle
EthanArbuckle / main.m
Last active March 3, 2025 18:46
Watch for changes to an ivar
//
// main.m
//
// Created by ethanarbuckle
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <mach/mach.h>
#import <execinfo.h>
@EthanArbuckle
EthanArbuckle / main.m
Created October 28, 2024 01:27
objc object search
#import <objc/runtime.h>
#import <mach/mach.h>
#import <malloc/malloc.h>
#import <dlfcn.h>
typedef struct {
Class targetClass;
void (^block)(id object, BOOL isSubclass, BOOL *stop);
dispatch_semaphore_t semaphore;
BOOL shouldStop;
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <objc/message.h>
#import <dlfcn.h>
__attribute__((constructor)) static void init(void) {
Method bundleIdentifierMethod = class_getInstanceMethod(objc_getClass("NSBundle"), sel_registerName("bundleIdentifier"));
IMP newImp = imp_implementationWithBlock(^(id self) {