Skip to content

Instantly share code, notes, and snippets.

@0xallie
0xallie / exit_vs_sys_exit.txt
Last active September 30, 2022 18:00
exit() vs sys.exit()
❯ python
Python 3.10.7 (main, Sep 7 2022, 12:19:18) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> try:
... exit()
... except SystemExit:
... print("no exit for you")
... finally:
... print("cleanup")
...
from __future__ import annotations
import argparse
import os
import subprocess
from pathlib import Path
def strip_cc(file: Path | os.PathLike[str]) -> None:
"""
@0xallie
0xallie / dsnp_chapters.py
Last active April 4, 2024 21:14
Code to get chapters from Disney+ (for BAMSDK v7.3.0)
def get_chapters(self, title):
milestones = []
for type_, type_milestones in title.service_data.get("milestone").items():
for milestone in type_milestones:
milestones.append((type_, milestone))
if not milestones:
return []
types = {
# https://github.com/IMFTool/IMFTool/blob/master/src/ImfCommon.cpp#L458-L504
@0xallie
0xallie / a11dfu.sh
Last active September 24, 2023 00:14
Helper script to enter DFU mode from recovery on A11+ devices
#!/bin/sh -e
step() {
for i in $(seq "$1" -1 1); do
printf '\r\e[1;36m%s (%d) ' "$2" "$i"
sleep 1
done
printf '\r\e[0m%s (0)\n' "$2"
}
import re
def fstring(s):
"""Parse f-string expressions and return the formatted version.
This lets you replace f'...' with fstring('...') and have it work on Python versions older than 3.6.
Note that this is just a fun project rather than a serious one, and may not be perfect, but feel free to use it.
Example:
@0xallie
0xallie / checkm8_downgrade.md
Last active February 2, 2024 08:47
Guide for downgrading checkm8 devices
@0xallie
0xallie / libimobiledevice.Dockerfile
Last active July 22, 2023 23:43
Docker image to statically compile libimobiledevice suite binaries for Linux x86_64
FROM alpine AS base
ENV CONF_ARGS="--disable-shared" \
CMAKE_ARGS="-DBUILD_SHARED_LIBS=0" \
CC="clang-15" \
CXX="clang++-15" \
LD="ld.lld" \
LDFLAGS="-no-pie -static -static-libgcc -Wl,--no-dynamic-linker -Wl,-static"
RUN apk add --no-cache autoconf automake ca-certificates clang15 cmake eudev-dev gcc git gnupg libtool linux-headers make musl-dev ncurses-static ncurses-terminfo nghttp2-dev nghttp2-static openssl-dev openssl-libs-static pkgconf wget xz zlib-dev zlib-static
FROM base AS libplist
@0xallie
0xallie / btn-site-tags.md
Last active May 29, 2022 12:54 — forked from rlaphoenix/btn-site-tags.md
BTN Site Tags
Site/Network Abbreviation
9Now 9NOW
A&E AE
ABC (AU) iView AUBC
ABC (US) AMBC
Adult Swim AS
Al Jazeera English AJAZ
All4 (Channel 4, ex-4oD) ALL4
Amazon AMZN
@0xallie
0xallie / pallas.sh
Last active April 7, 2021 14:58 — forked from Siguza/pallas.sh
newstyle OTA
#!/bin/zsh
set -e;
incr=false;
if [ "$1" = '-i' ]; then
incr=true;
shift;
fi;
#!/bin/bash -e
echo '[+] Installing dependencies from apt'
sudo apt-get -y update
sudo apt-get -y install --no-install-recommends autoconf autogen automake g++ gcc git libc6-dev libcurl4-openssl-dev libreadline-dev libssl-dev libtool libudev-dev libzip-dev m4 make pkg-config python3-dev zlib1g-dev
tmpdir=$(mktemp -d)
pushd "$tmpdir" &>/dev/null
for lib in libusb/libusb libimobiledevice/libirecovery libimobiledevice/libplist tihmstar/libgeneral tihmstar/libfragmentzip DanTheMann15/tsschecker; do