Skip to content

Instantly share code, notes, and snippets.

View DerekSelander's full-sized avatar
👠
Set your status

Derek DerekSelander

👠
Set your status
View GitHub Profile
@paultheman
paultheman / mac_keyremapping.md
Last active November 13, 2024 20:51
Guide on how to remap Keyboard keys on macOS

Guide on how to remap Keyboard keys on macOS

Update: since macOS 14.2 hidutil requires root privileges.

If you have a mac with an INT (ISO) keyboard you might want to change the ± key to ~. During my research I found that the information on this topic is not at all centralized. I prefer this option because it does not involve installing new software.

With macOS 10.12 Sierra Apple introduced hidutil as a tool to remap keyboard keys. See TN2450.

1. Lets list our HID devices:

@LinusHenze
LinusHenze / iOS_16_Launch_Constraints.txt
Created June 15, 2022 16:30
Description of the Launch Constraints introduced in iOS 16
iOS 16 introduced launch constraints, which can be used to constraint the launch of an application.
There are three types of constraints:
Self Constraints, which the launched application itself must meet
Parent Constraints, which the parent process must meet
Responsible Constraints, which the "responsible process" must meet (I assume that the responsible process is the process that asked launchd to launch a service)
Additionally, the TrustCache format was updated (see below) to support assigning each binary a "Constraint Category", which forces Self and Parent Constraints.
Note that Self, Parent and Responsible Constraints can also be set by the process performing the launch and they can be included in the code signature, in the new blob type 0xFADE8181. In both cases, the constraints are DER encoded (just like the DER entitlements).
Constraint Categories (from TrustCache, new in version 2):

ARMv8.3 Pointer Authentication in xnu

Introduction

This document describes xnu's use of the ARMv8.3-PAuth extension. Specifically, xnu uses ARMv8.3-PAuth to protect against Return-Oriented-Programming (ROP) and Jump-Oriented-Programming (JOP) attacks, which attempt to gain control flow over a victim program by overwriting return addresses or function pointers

@nooriro
nooriro / sunfish-bootloader-baseband-mcfg-versions.txt
Last active July 19, 2022 18:11
codename initial build_number bootloader_version baseband_version system_size vendor_size product_size system_ext_size build_incremental build_timestamp mcfg_version
sunfish Q QD4A.200317.024.A1 s5-0.2-6281315 g7150-00013-200421-B-6413509 806584320 571858944 2183749632 0 6456895 1588517452 MCFG-g7150-00013-200416-B-6400682
sunfish Q QD4A.200317.027 s5-0.2-6281315 g7150-00013-200424-B-6426960 806584320 571858944 2183749632 0 6463901 1588696545 MCFG-g7150-00013-200424-B-6426960
sunfish Q QD4A.200805.001 s5-0.2-6281315 g7150-00013-200421-B-6413509 806588416 571871232 2183778304 0 6583866 1591947723 MCFG-g7150-00013-200424-B-6426960
sunfish Q QD4A.200805.003 s5-0.2-6281315 g7150-00013-200424-B-6426960 806588416 571871232 2183778304 0 6598198 1592375158 MCFG-g7150-00013-200424-B-6426960
sunfish R RPB3.200720.005 s5-0.2-6539975 g7150-00018-200701-B-6643937 819929088 550354944 2050846720 231133184 6705141 1595555810 MCFG-g7150-00018-200701-B-6643937
sunfish R RP1A.200720.010 s5-0.2-6539975
csrutil disable
sudo nvram boot-args="intcoproc_unrestricted=1 kext-dev-mode=1 amfi_allow_any_signature=1 amfi_unrestrict_task_for_pid=1 PE_i_can_has_debugger=1 cs_enforcement_disable=1 amfi_get_out_of_my_way=1 amfi=0xff cs_debug=1 ipc_control_port_options=0"
sudo spctl --global-disable
sudo defaults write /Library/Preferences/com.apple.security GKAutoRearm -bool NO
sudo defaults write /Library/Preferences/com.apple.security.coderequirements Entitlements -string always
sudo defaults write /Library/Preferences/com.apple.security.coderequirements AllowUnsafeDynamicLinking -bool YES
sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool YES
defaults write com.apple.loginwindow DisableScreenLockImmediate -bool yes
@tom-seddon
tom-seddon / mach.org
Last active November 14, 2024 20:30
Random Mach notes

Random Mach notes

mach_thread_self increments ref count

Each call to mach_thread_self adds another MACH_PORT_RIGHT_SEND refcount. For each call to mach_thread_self, you need to call mach_port_deallocate on the result.

(This does not apply to mach_task_self.)

@knightsc
knightsc / build-xnu-6153.11.26.sh
Created February 18, 2020 15:08
A script to build XNU version 6153.11.26 (macOS Catalina 10.15).
#! /bin/bash
#
# build-xnu-6153.11.26.sh
# Scott Knight
#
# Based on the script by Brandon Azad
# https://gist.github.com/bazad/654959120a423b226dc564073b435453
#
# A script showing how to build XNU version 6153.11.26 on macOS Catalina
# 10.15 with Xcode 11.13.1.
@bazad
bazad / vmmap.c
Last active January 4, 2024 16:32
A simple vmmap implementation for macOS.
// Brandon Azad (@_bazad)
#include <assert.h>
#include <errno.h>
#include <mach/mach.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@icecr4ck
icecr4ck / idapython_cheatsheet.md
Last active November 14, 2024 03:57
Cheatsheet for IDAPython
@keith
keith / simctl-commands.txt
Last active December 7, 2022 23:27
All the subcommands of `xcrun simctl` (including ones that aren't listed in `simctl help`) LC_SOURCE_VERSION 776.1 (Xcode 13.0 beta 5)
addmedia
addphoto
addvideo
appinfo
boot
bootstatus
clone
create
darwinup
delete