Skip to content

Instantly share code, notes, and snippets.

UPDATE

Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:

  • Open the Disk Utility app.
  • Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
  • Set the parameters and click on "Save" to create the blank disk image.
  • After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
  • Run the package installer by double clicking on the package file.
  • Select this newly created blank disk image as the destination and install it.
  • If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can:
@manjuhere
manjuhere / fat-build.sh
Created March 11, 2019 15:16
Create a Universal Static Library/FAT framework for iOS. Combines arm (device) and x86(simulator) architectures.
#!/bin/sh
CUR_DIR=$(eval "pwd")
if [[ $1 == '' ]]; then
echo "Provide scheme to generate the Frameworks"
echo "./framework-build.sh (scheme_name)"
exit 1
fi
scheme=$1
@oleavr
oleavr / jit-example.js
Created January 27, 2019 20:18
Frida JIT example
'use strict';
const slowCallback = new NativeCallback(value => {
console.log('slowCallback hit');
return 43;
}, 'int', ['int']);
const fastCallback = Memory.alloc(Process.pageSize);
Memory.patchCode(fastCallback, 128, code => {
const cw = new X86Writer(code, { pc: fastCallback });
@mikepruett3
mikepruett3 / shell-setup.ps1
Last active May 11, 2024 04:45
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?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">
@cmsj
cmsj / iOS-File-System-Extraction.md
Created July 31, 2017 12:04
Guide to extract the root file system and decompress the kernel cache for iOS.

iOS File System Extraction

For iOS 10 and Up

Starting with iOS 10.0 Apple decrypted the file system and kernel cache. All you have to do is download an IPSW, change the extension to .zip, and unarchive it. The largest size disk image inside the unarchived zip will be the root file system. Simply mount it to see its contents.

Links to download all iOS IPSWs.

For iOS 9 and Below

Originally from /u/RowRocka on Reddit. Gently edited for clarity.

Links to download all iOS OTA ZIPs.

@ascendbruce
ascendbruce / README.md
Last active May 8, 2024 17:50
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

ℹ️ There is a newer alternative project that does similar things and more, check it out at https://github.com/stevenilsen123/mac-keyboard-behavior-in-windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

How does it work

@JadenGeller
JadenGeller / Swift Atomic Operators.swift
Created March 17, 2015 01:38
Swift Atomic Operators
import Foundation
infix operator +=! { associativity right precedence 90 } // Int32 or Int64
infix operator -=! { associativity right precedence 90 } // Int32 or Int64
postfix operator ++! {} // Int32 or Int64
postfix operator --! {} // Int32 or Int64
infix operator |=! { associativity right precedence 90 } // UInt32
infix operator &=! { associativity right precedence 90 } // UInt32
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@stuartsierra
stuartsierra / fresh-chrome.sh
Last active October 13, 2020 16:07
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every