Skip to content

Instantly share code, notes, and snippets.

Install Tamarin firmware on Raspberry Pico

Everything here is done on Ubuntu 22.04

Install some dependencies : sudo apt install cmake gcc-arm-none-eabi g++ git.

Clone the Pico SDK, then clone the Tamarin firmware and build it:

mkdir -p tamarin; cd $_
@blacktop
blacktop / DeviceTree.vma2macosap.md
Last active January 30, 2022 17:46
AssetData/boot/Firmware/all_flash/DeviceTree.vma2macosap.im4p
❯ brew install blacktop/tap/ipsw
❯ ipsw download ota -V --macos --device Macmini9,1 --model J274AP
❯ unzip -l 8093b01ee46664b82427188ff61334501fd1b0d8.zip | grep DeviceTree
@temoki
temoki / All_NSCocoaErrorDomain.swift
Created July 21, 2020 06:31
All NSCocoaErrorDomain
import Foundation
let allCodes: [(Int, String)] = [
(NSFileNoSuchFileError,"NSFileNoSuchFileError"),
(NSFileLockingError,"NSFileLockingError"),
(NSFileReadUnknownError,"NSFileReadUnknownError"),
(NSFileReadNoPermissionError,"NSFileReadNoPermissionError"),
(NSFileReadInvalidFileNameError,"NSFileReadInvalidFileNameError"),
(NSFileReadCorruptFileError,"NSFileReadCorruptFileError"),
(NSFileReadNoSuchFileError,"NSFileReadNoSuchFileError"),
@mmaday
mmaday / s3-get.sh
Last active April 2, 2024 06:46 — forked from jpillora/s3get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
@jfeilbach
jfeilbach / grub.md
Last active February 8, 2024 10:06
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

void inject_trusts(int pathc, const char *paths[])
{
printf("[+] injecting into trust cache...\n");
extern uint64_t g_kern_base;
static uint64_t tc = 0;
if (tc == 0) {
/* loaded_trust_caches
iPhone11,2-4-6: 0xFFFFFFF008F702C8
/*
Task Description
interval_map<K,V> is a data structure that efficiently associates intervals of keys of type K with values of type V. Your task is to implement the assign member function of this data structure, which is outlined below.
interval_map<K, V> is implemented on top of std::map. In case you are not entirely sure which functions std::map provides, what they do and which guarantees they provide, we provide an excerpt of the C++ standard here:
Each key-value-pair (k,v) in the std::map means that the value v is associated with the interval from k (including) to the next key (excluding) in the std::map.
Example: the std::map (0,'A'), (3,'B'), (5,'A') represents the mapping
@gcatlin
gcatlin / sdl-metal-example.m
Last active April 20, 2024 13:04
Minimal C SDL2 Metal example
//
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out
//
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main (int argc, char *args[])
{
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
@freedomtan
freedomtan / d331pap-dt.txt
Created October 1, 2018 15:21
iPhone XS Max (D331PAP) Device Tree
Device Tree with 18 properties and 17 children
Properties:
device-tree:
| +--target-type 6 bytes: D331p 0x44 0x33 0x33 0x31 0x70 0x00
| +--mlb-serial-number 29 bytes: syscfg/MLB#/0x20,zeroes/0x20 0x73 0x79 0x73 0x63 0x66 0x67 0x2f 0x4d 0x4c 0x42 0x23 0x2f 0x30 0x78 0x32 0x30 0x2c 0x7a 0x65 0x72 0x6f 0x65 0x73 0x2f 0x30 0x78 0x32 0x30 0x00
| +--compatible 28 bytes: (null) 0x44 0x33 0x33 0x31 0x70 0x41 0x50 0x00 0x69 0x50 0x68 0x6f 0x6e 0x65 0x31 0x31 0x2c 0x36 0x00 0x41 0x70 0x70 0x6c 0x65 0x41 0x52 0x4d 0x00
| +--secure-root-prefix 3 bytes: md 0x6d 0x64 0x00
| +--AAPL,phandle 4 bytes: (null) 0x01 0x00 0x00 0x00
| +--platform-name 32 bytes: (null) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
| +--device_type 8 bytes: (null) 0x62 0x6f 0x6f 0x74 0x72 0x6f 0x6d 0x00
@freedomtan
freedomtan / d331ap-dt.txt
Last active October 17, 2018 17:33
iPhone XS Max (D331AP) Device tree
Device Tree with 18 properties and 17 children
Properties:
device-tree:
| +--target-type 5 bytes: D331 0x44 0x33 0x33 0x31 0x00
| +--mlb-serial-number 29 bytes: syscfg/MLB#/0x20,zeroes/0x20 0x73 0x79 0x73 0x63 0x66 0x67 0x2f 0x4d 0x4c 0x42 0x23 0x2f 0x30 0x78 0x32 0x30 0x2c 0x7a 0x65 0x72 0x6f 0x65 0x73 0x2f 0x30 0x78 0x32 0x30 0x00
| +--compatible 27 bytes: D331AP 0x44 0x33 0x33 0x31 0x41 0x50 0x00 0x69 0x50 0x68 0x6f 0x6e 0x65 0x31 0x31 0x2c 0x34 0x00 0x41 0x70 0x70 0x6c 0x65 0x41 0x52 0x4d 0x00
| +--secure-root-prefix 3 bytes: md 0x6d 0x64 0x00
| +--AAPL,phandle 4 bytes: (null) 0x01 0x00 0x00 0x00
| +--platform-name 32 bytes: (null) 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
| +--device_type 8 bytes: (null) 0x62 0x6f 0x6f 0x74 0x72 0x6f 0x6d 0x00