Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolás Alvarez nicolas17

  • Buenos Aires, Argentina
View GitHub Profile
@nicolas17
nicolas17 / yellow.asm
Last active Jan 13, 2023
hello-world iOS app
View yellow.asm
.global _main
.extern _putchar
.align 4
_main:
// prolog; save fp,lr,x19
stp x29, x30, [sp, #-0x20]!
str x19, [sp, #0x10]
View addipsw.py
#!/usr/bin/python3
# SPDX-FileCopyrightText: 2022 Nicolás Alvarez <nicolas.alvarez@gmail.com>
#
# SPDX-License-Identifier: MIT
import os
import sys
import json
import re
View storage.md

3 people have 6x16TB, 96TB each, total raw storage is 288TB across 18 disks

Configuration Usable storage Resilience
Each person does RAID-6
The same data is stored by all people
4x16TB = 64TB Any 7 disks can be lost (worst case 2 people lose 3 disks each and lose the RAID, third person loses 2 disks and can still recover).
If we're lucky, max 14 disks can be lost (two people lose all 6 disks, third person loses 2 disks).
Any person has all data locally without needing other nodes.
Each person does RAID-5
The same data is stored by all people
5x16TB = 80TB Any 5 disks can be lost (worst case 2 people lose 2 disks each and lose the RAID, third person loses 1 disk and can still recover).
If we're lucky, max 13 disks can be lost (two people lose all 6 disks, third person loses 1 disk).
Any person has all data locally without needing other nodes.
Spread files across all disks/peopleUse 6-of-18 parity 6x16TB = 96TB Any 12 disks can be lost, but n
@nicolas17
nicolas17 / gist:07df9344adef593f289ee2123c8990d5
Created Aug 3, 2022
Apple's DMCA against tweets linking to ipsw.dev
View gist:07df9344adef593f289ee2123c8990d5
Copyright owner:
> Apple Inc.
Name:
> Louis Ferrari
Company:
> Kilpatrick Townsend Stockton LLP
Job title:
> Case Manager
Email:
> appleip@kilpatricktownsend.com
@nicolas17
nicolas17 / wiki-todo.md
Last active Aug 18, 2021
theiphonewiki key pages TODO
View wiki-todo.md

Things to do before I mass-upload A14 keys to the wiki:

[ ] Script outputs ANS = ansf.t8101.release.im4p and RestoreANS = rans.t8101.release.im4p. Key template accepts ANSF= and RANS=. Either the script should rename ANS->ANSF and RestoreANS->RANS, or the key template should be modified to use ANS/RestoreANS (it seems there are no key pages using these yet).

[x] Script outputs Ap,Scorpius = mconnector_rev13p.im4p, script should rename to MConnector = which the key template already accepts.

@nicolas17
nicolas17 / README.md
Last active Apr 15, 2021
Verify your git-bisect run script
View README.md

When using git bisect run ./test.sh it's not uncommon to get the condition in test.sh wrong. This can cause a lot of wasted time as you only notice the mistake hours later when bisect finishes and points at the wrong commit.

This Python script runs the test script against the commits you already marked as good or bad in the bisect session (either with 'git bisect good/bad' or as part of the 'git bisect start' command) and ensures your test script returns the correct status code.

@nicolas17
nicolas17 / CVE-2021-3449.md
Last active Mar 29, 2021
Exploit for CVE-2021-3449 (OpenSSL null ptr deref)
View CVE-2021-3449.md

Download openssl-1.1.1j (1.1.1k probably works too but I didn't test).

Apply this patch (or manually edit the one line):

diff -ur openssl-1.1.1j/ssl/statem/extensions_clnt.c openssl-1.1.1j-patched/ssl/statem/extensions_clnt.c
--- openssl-1.1.1j/ssl/statem/extensions_clnt.c 2021-02-16 12:24:01.000000000 -0300
+++ openssl-1.1.1j-patched/ssl/statem/extensions_clnt.c 2021-03-25 14:56:40.072257668 -0300
@@ -272,7 +272,7 @@
         return EXT_RETURN_NOT_SENT;
 
@nicolas17
nicolas17 / boostpp_math.c
Created Nov 4, 2020
Cursed boost.pp math
View boostpp_math.c
// SPDX-FileCopyrightText: 2020 Nicolás Alvarez <nicolas.alvarez@gmail.com>
//
// SPDX-License-Identifier: MIT
#include <boost/preprocessor.hpp>
// Utilities to convert from numbers (bytes) or words (highbyte,lowbyte pairs)
// into nibbles.
// a -> (a1,a0)
@nicolas17
nicolas17 / moo.cpp
Created Sep 27, 2020
Microsoft's moo.cxx gdiplus test
View moo.cpp
#include <stdio.h>
#include <math.h>
#include <windows.h>
#include <objbase.h>
#include <gdiplus.h>
// moo.cxx ran through the preprocessor, and replacing "GetDC(1-1)" with "dc"
// (apparently on newer Windows versions you're not allowed to use GetDC(NULL)
// to draw to the screen directly)
@nicolas17
nicolas17 / reduced.ll
Last active Jul 22, 2020
opt reduced.ll --ipsccp -S
View reduced.ll
; ModuleID = 'reduced.ll'
source_filename = "reduced.ll"
define void @_mesa_test_texobj_completeness(i32* %0) {
%2 = icmp uge i64 undef, undef
%3 = icmp slt i64 undef, undef
%4 = and i1 %3, %2
br i1 undef, label %exit, label %a