Skip to content

Instantly share code, notes, and snippets.

View networkextension's full-sized avatar

abigt networkextension

  • Star
View GitHub Profile
@rodionovd
rodionovd / mach_exceptions.cpp
Last active December 6, 2024 18:18
Mach exception handling examples by Apple
/*
File: ExceptionTest.c
Contains: Test code for Mach exception handling.
Written by: DTS
Copyright: Copyright (c) 2006 by Apple Computer, Inc., All Rights Reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
@landonf
landonf / xpc-helper
Last active June 22, 2020 17:08
XPC-based privileged helper
- (BOOL)blessHelperWithLabel:(NSString *)label error:(NSError **)error {
BOOL result = NO;
AuthorizationItem authItem = { kSMRightBlessPrivilegedHelper, 0, NULL, 0 };
AuthorizationRights authRights = { 1, &authItem };
AuthorizationFlags flags = kAuthorizationFlagDefaults |
kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagPreAuthorize |
kAuthorizationFlagExtendRights;
@agam
agam / gist:5872178
Created June 26, 2013 22:07
Assembly version of binary and n-ary trees in C++
.file "tree.cpp"
.text
.align 16, 0x90
.type __cxx_global_var_init,@function
__cxx_global_var_init: # @__cxx_global_var_init
.Ltmp2:
.cfi_startproc
# BB#0:
pushq %rbp
.Ltmp3:
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active April 26, 2025 12:16
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S