Skip to content

Instantly share code, notes, and snippets.

@PoomSmart
PoomSmart / YouTubeDefaultVideoQuality.x
Last active April 28, 2024 08:31
Sets the default video quality for videos on iOS YouTube.
#import <YouTubeHeader/MLAVPlayer.h>
#import <YouTubeHeader/MLHAMPlayerItem.h>
#import <YouTubeHeader/MLQuickMenuVideoQualitySettingFormatConstraint.h>
int targetResolution = 1440;
int targetFPS = 60;
static NSString *getClosestQualityLabel(NSArray <MLFormat *> *formats) {
int minDiff = INT_MAX;
int selectedFPS = 0;
@matteyeux
matteyeux / decrypted.json
Created November 20, 2023 13:15
Apple Vision Pro firmware keys for VisionOS 1.0 beta 1-5
[
{
"url": "https://updates.cdn-apple.com/2023SummerSeed/patches/042-21091/60572AF0-9BC3-465F-89ED-77117194CB26/com_apple_MobileAsset_SoftwareUpdate/3df121022bd578846478faa25a4dcf3055396954.zip",
"build": "21N5207g",
"filename": "iBEC.n301.RELEASE.im4p",
"kbag": "AB7893B981E44BFF298328C89C826F8BA6EF1A7ADC80DB156C9D55D9F4E27E8AD2CC21AFA42A41E1392B57E9FE90D992",
"key": "34b218667cd03eb93e073b9b3bca4a865b20f130550a800b2aa2c1c2348041865cee47db7e3bcda739d05adde9f9f716"
},
{
"url": "https://updates.cdn-apple.com/2023SummerSeed/patches/042-21091/60572AF0-9BC3-465F-89ED-77117194CB26/com_apple_MobileAsset_SoftwareUpdate/3df121022bd578846478faa25a4dcf3055396954.zip",
@saagarjha
saagarjha / file_drain.c
Created November 11, 2023 10:01
"Drain" files while they are processed to reduce free disk space requirements
// Sometimes you have a large file on a small disk and would like to "transform"
// it in some way: for example, by decompressing it. However, you might not have
// enough space on disk to keep both the the compressed file and the
// decompressed results. If the process can be done in a streaming fashion, it
// would be nice if the file could be "drained"; that is, the file would be
// sequentially deleted as it is consumed. At the start you'd have 100% of the
// original file, somewhere in the middle you'd have about half of the original
// file and half of your output, and by the end the original file will be gone
// and you'll be left with just the results. If you do it this way, you might
// be able to do the entire operation without extra space!
@leptos-null
leptos-null / abi.py
Last active September 10, 2023 22:55 — forked from dlevi309/abi.py
script to switch between iOS13 (00000002) and iOS14 (80000002) arm64e ABI
import sys
FAT_MAGIC = b'\xca\xfe\xba\xbe' # big endian
FAT_MAGIC_64 = b'\xca\xfe\xba\xbf' # big endian
MH_MAGIC_64 = b'\xfe\xed\xfa\xcf' # big endian
MH_CIGAM_64 = b'\xcf\xfa\xed\xfe' # little endian
CPU_TYPE_ARM64 = b'\x01\x00\x00\x0c' # big endian
CPU_SUBTYPE_IOS13 = b'\x00\x00\x00\x02' # big endian
@Lessica
Lessica / patch-to-securityd-tweak.mm
Last active February 28, 2024 11:28
A patch to securityd
#import <Foundation/Foundation.h>
#import <os/log.h>
#define FAKE_BASE 0x100000000
#define FAKE_PAGE 4096
template <unsigned B> inline int64_t SignExtend64(uint64_t x) {
static_assert(B > 0, "Bit width can't be 0.");
static_assert(B <= 64, "Bit width out of range.");
return int64_t(x << (64 - B)) >> (64 - B);
@matteyeux
matteyeux / avp.md
Last active November 14, 2023 13:01
@zhuowei
zhuowei / reachable_services.txt
Created February 21, 2023 06:26
Reachable Mach services from the app sandbox on iOS 16.1
PurpleSystemAppPort
PurpleSystemEventPort
UIASTNotificationCenter
com.apple.ABDatabaseDoctor
com.apple.AppSSO.service-xpc
com.apple.AuthenticationServicesCore.AuthenticationServicesAgent
com.apple.CARenderServer
com.apple.ClipServices.clipserviced
com.apple.CoreAuthentication.daemon
com.apple.DeviceAccess.xpc
@0xallie
0xallie / apnoncer.m
Last active August 9, 2023 19:45
Get APNonce and generator on macOS / jailbroken iOS with root privileges (SIP can be enabled)
//
// main.m
// apnoncer
//
// Created by alexia on 2023-02-15.
//
@import CoreFoundation;
@import Foundation;
#import <dlfcn.h>
@Lessica
Lessica / MGCopyAnswer-Tweak.mm
Last active March 17, 2024 19:04
Hook Internal Implementation of MGCopyAnswer (iOS 15)
#import <dlfcn.h>
#import <os/log.h>
#import <substrate.h>
#import <Foundation/Foundation.h>
#import "pac_helper.h"
#define _FUNC_ADDR_(A, O) (const void *)((long)(A) + (O))
/* ... */
@ericlewis
ericlewis / WKChatGPT.swift
Created December 22, 2022 18:58
A way of using ChatGPT with SwiftUI
import SwiftUI
import WebKit
// MARK: Observable Object
public class Chat: NSObject, ObservableObject {
internal var webView: WKWebView
private var decoder: JSONDecoder = {
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase