Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Wowfunhappy / gist:0e21294a528c370120060e1115dd581f
Created March 13, 2025 14:24
Add ISRG Root X1 certificate to legacy macOS
# One-line Terminal command to add the ISRG Root X1 certificate to old versions of macOS / OS X.
# Run this command while connected to the internet via a trustworthy source.
# An example of a trustworthy source would (probably) be a password-protected home WiFi network.
# An example of an untrustedworthy source would be the public WiFi at your local coffee shop.
curl 'http://x1.i.lencr.org' > /tmp/ISRGRootX1.pem && sudo security -v add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/ISRGRootX1.pem
@Wowfunhappy
Wowfunhappy / proxy.go
Last active March 12, 2025 11:18
Go Proxy
// Written (entirely) by a combination of o1, o3-mini, and claude 3.5 sonnet, with lots of human testing and trial-and-error.
// This proxy will mitm https requests so that old apps on legacy versions of OS X can connect to modern https servers.
// Unlike Squid, this proxy does not appear to cause issues with pip or websockets.
// It does not require special rules for Apple domains to avoid breaking iMessage. It appears to be side effect free!
// Also unlike Squid, this proxy uses OS X's System Trust store for remote certificate validation.
// This is a good thing, but it means you probably want to manually add some modern certificates to Keychain Access,
// such as ISRG Root X1 certificate and GTS Root R1.
@Wowfunhappy
Wowfunhappy / download-mavericks.sh
Last active March 13, 2025 13:47
Download a Mac OS X 10.9 Mavericks installer image Apple
#!/bin/bash
#!/bin/sh
# Download script written by Wowfunhappy. Last updated 2025/03/07.
# Thank you to Krackers, Jazzzny, and others for helping analyze Apple's download process and debug this script.
# Thank you to dosdude1 for donating identifiers from a broken Mac.
# Any mistakes are mine alone.
BOARD_SERIAL_NUMBER="C0243070168G3M91F"
@Wowfunhappy
Wowfunhappy / main.m
Last active March 5, 2025 10:39
Firefox Key Equivalent Fixer
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import "ZKSwizzle.h"
@interface myNSApplication : NSApplication
@end
@Wowfunhappy
Wowfunhappy / gist:ab459b4bf7c070f31300894c42c427a4
Last active May 27, 2024 16:26
Build Ship of Harkinian for Mac OS X 10.9
Last used with this commit: https://github.com/HarbourMasters/Shipwright/commit/ad0e17383e72c652541e6a90367ab720c6a18723
1. sudo port install libsdl2 libpng glew ninja cmake libzip nlohmann-json boost legacy-support clang-17 macports-libcxx tinyxml2
2. git clone --recursive https://github.com/HarbourMasters/Shipwright.git
@Wowfunhappy
Wowfunhappy / Part 1.py
Created January 23, 2024 22:47
Advent of Code 2022 Day 3
input = open("input.txt")
rucksacks = input.readlines()
commonItems = []
def findCommonItem(compartmentA, compartmentB):
for i in range(0, len(compartmentA)):
for j in range(0, len(compartmentB)):
if (compartmentA[i] == compartmentB[j]):
return compartmentA[i]
import itertools
import random
import time
import re
MAX_EXPONENT = 5
solutionList = []
#Based on https://theconfused.me/blog/solving-the-24-game/
def solve(numbers, expr=[]):
@Wowfunhappy
Wowfunhappy / Info.plist
Last active September 8, 2024 19:50
KQueueScanContinuePatch
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>wowfunhappy.$(PRODUCT_NAME:rfc1034identifier)</string>
@Wowfunhappy
Wowfunhappy / noCFRelease.m
Created April 21, 2022 18:02
Why deal with use-after-free crashes when you can just leak memory instead?
//COMPILE: clang -framework Foundation noCFRelease.m -undefined dynamic_lookup -dynamiclib -o noCFRelease.dylib
//USE: DYLD_INSERT_LIBRARIES=/path/to/noCFRelease.dylib /path/to/foo.app/Contents/MacOS/foo
#include <CoreFoundation/CoreFoundation.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 };
Install patched qt 5.9: https://github.com/Wowfunhappy/qt5.9-base-mavericks
sudo port install clang-13 cmake meson ninja graphviz git realpath
git clone --recurse-submodules https://github.com/rizinorg/cutter
mkdir build-cutter && cd build-cutter
cmake \
-DCMAKE_PREFIX_PATH=/usr/local/Qt-5.9.9/ \