Skip to content

Instantly share code, notes, and snippets.

@dlevi309
dlevi309 / abi.py
Last active March 26, 2024 16:57
script to switch between iOS13 (00000002) and iOS14 (80000002) arm64e ABI
import sys
from pathlib import Path
MH_MAGIC_64 = b'\xcf\xfa\xed\xfe'
CPU_TYPE_ARM64 = b'\x0c\x00\x00\x01'
CPU_SUBTYPE_IOS13 = b'\x02\x00\x00\x00'
CPU_SUBTYPE_IOS14 = b'\x02\x00\x00\x80'
IOS13_HEADER = MH_MAGIC_64 + CPU_TYPE_ARM64 + CPU_SUBTYPE_IOS13
IOS14_HEADER = MH_MAGIC_64 + CPU_TYPE_ARM64 + CPU_SUBTYPE_IOS14
@dlevi309
dlevi309 / libproc.h
Last active March 10, 2022 07:39 — forked from bazad/vmmap.c
A simple vmmap implementation for macOS.
#ifndef _LIBPROC_H_
#define _LIBPROC_H_
#include <stdbool.h>
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/mount.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/stat.h>
@dlevi309
dlevi309 / 02_decompress.c
Last active December 27, 2021 00:25
NewOSXBook - listings
///////////////////////////////////////////////////////////////////////////////
//
/// \file 02_decompress.c
/// \brief Decompress .xz files to stdout
///
/// Usage: ./02_decompress INPUT_FILES... > OUTFILE
///
/// Example: ./02_decompress foo.xz bar.xz > foobar
//
// Author: Lasse Collin
@dlevi309
dlevi309 / cpu-swipe.py
Last active June 4, 2022 09:34
switch between iOS14 (80000002) and iOS13 (00000002) cpu subtypes for arm64e. Credit and thanks to @doronz88 for his help
import sys
from pathlib import Path
MH_MAGIC_64 = b'\xcf\xfa\xed\xfe'
CPU_TYPE_ARM64 = b'\x0c\x00\x00\x01'
CPU_SUBTYPE_IOS13 = b'\x02\x00\x00\x00'
CPU_SUBTYPE_IOS14 = b'\x02\x00\x00\x80'
IOS13_HEADER = MH_MAGIC_64 + CPU_TYPE_ARM64 + CPU_SUBTYPE_IOS13
IOS14_HEADER = MH_MAGIC_64 + CPU_TYPE_ARM64 + CPU_SUBTYPE_IOS14
@dlevi309
dlevi309 / SafariSecretFall2021.txt
Last active October 25, 2021 23:35
These were found in a file titled SafariSecretFall2021.strings
{
"Allow Website Tinting" = "Allow Website Tinting";
"Auto-Play" = "Auto-Play";
"Compact Tab Bar" = "Compact Tab Bar";
"Current tab description in list of websites" = "the current tab\U2019s webpage when you use the extension";
"Default Start Page Title (Drill In)" = "Start Page";
"Default Start Page Title (Top Level)" = "On Start Page";
"Explanation section title - Browsing History" = "Browsing History";
"Explanation section title - Webpage Contents" = "Webpage Contents";
"Explanation section title - Webpage Contents and Browsing History" = "Webpage Contents and Browsing History";
#import <UIKit/UIKit.h>
@interface UIDevice : NSObject
@property (assign, nonatomic) long long UIUserInterfaceIdiom;
@end
typedef NS_ENUM(NSInteger, UIUserInterfaceIdiom) {
UIUserInterfaceIdiomUnspecified = -1,
UIUserInterfaceIdiomPhone = 0,
UIUserInterfaceIdiomPad = 1,
@interface MIGlobalConfiguration : NSObject {}
@end
@interface MIDaemonConfiguration : MIGlobalConfiguration {}
@property (nonatomic,readonly) BOOL skipDeviceFamilyCheck;
@property (nonatomic,readonly) BOOL skipThinningCheck;
@property (nonatomic,readonly) BOOL allowPatchWithoutSinf;
@property (nonatomic,readonly) BOOL codeSigningEnforcementIsDisabled;
@property (nonatomic,readonly) BOOL isInternalImageType;
-(BOOL)isInternalImageType;
@dlevi309
dlevi309 / MGAllowedProtectedKeys.xml
Last active May 6, 2022 01:32
All the values that iOS grants when using the ‘com.apple.private.MobileGestalt.AllowedProtectedKeys‘ entitlement
<?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.MobileGestalt.AllowedProtectedKeys</key>
<array>
<string>AWDID</string>
<string>AmbientLightSensorSerialNumber</string>
<string>ArcModuleSerialNumber</string>
<string>ArrowChipID</string>
@dlevi309
dlevi309 / build-iOS.sh
Last active October 23, 2021 07:53
Drop this script into the head directory of swift package with a CLI tool to build as an iOS target. Set NAME=ProductName
#!/bin/bash
set -e
NAME=sURL
function build() {
START=$(date +%s)
swift build --product $NAME \
@dlevi309
dlevi309 / ForceNoBuddy.md
Last active August 24, 2023 00:03
Forcibly skip iPhone Setup (PurpleBuddy)

ForceNoBuddy

Skip the iPhone setup screen on checkra1n devices, make sure these files are written to /var/mobile/Library/Preferences

This no longer works as of iOS 15 (or it might, but I'm pretty sure it's gone)

com.apple.purplebuddy.plist

<?xml version="1.0" encoding="UTF-8"?>