Skip to content

Instantly share code, notes, and snippets.

View obfusk's full-sized avatar
🏳️‍🌈
hacking ⇒ ¬sleeping 😸

FC (Fay) Stegerman obfusk

🏳️‍🌈
hacking ⇒ ¬sleeping 😸
View GitHub Profile
@obfusk
obfusk / break.py
Last active July 11, 2025 11:12
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@obfusk
obfusk / icons.py
Last active February 16, 2025 20:12
test apkrepotool icon extraction
import dataclasses
import sys
import zipfile
from pathlib import Path
import PIL
import PIL.Image
import apkrepotool
import apkrepotool.xml_icons as xml_icons
@obfusk
obfusk / reload.js
Last active February 15, 2025 22:03
reload all broken images
// firefox only
(async () => { for (const x of document.querySelectorAll("img:-moz-broken")) { x.src = x.src; await new Promise(r => setTimeout(r, 100)); console.log(x) }; console.log("done") })()
// generic
(async () => { for (const x of document.querySelectorAll("img")) { if (!x.naturalWidth) { x.src = x.src; await new Promise(r => setTimeout(r, 100)); console.log(x) } }; console.log("done") })()
@obfusk
obfusk / LICENSE.GPLv3
Last active February 15, 2025 20:43
-> https://github.com/obfusk/gradle-wrapper-verify | check gradle wrapper checksums
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
#!/usr/bin/python3
# encoding: utf-8
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <flx@obfusk.net>
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
import struct
import zipfile
from dataclasses import dataclass
@obfusk
obfusk / cdata.py
Last active January 25, 2025 21:24
#!/usr/bin/python3
import struct
import sys
import zipfile
zfile, entry = sys.argv[1:]
with zipfile.ZipFile(zfile) as zf:
info = zf.getinfo(entry)
with open(zfile, "rb") as fh:
@obfusk
obfusk / apkrepotool-cert.py
Last active January 19, 2025 22:42
get APK cert fingerprint using apkrepotool
#!/usr/bin/env python3
import hashlib
import sys
import apkrepotool
from pathlib import Path
for apk in sys.argv[1:]:
certs, _ = apkrepotool.get_signing_certs(Path(apk))
@obfusk
obfusk / per-day-downloads.py
Created January 18, 2025 00:23
per-day downloads for a specific IoD app
import glob
import json
import sys
from typing import Dict
appid, = sys.argv[1:]
results: Dict[str, int] = {}
for json_file in sorted(glob.glob("apk_downloads/*/*.json")):
with open(json_file, encoding="utf-8") as fh:
@obfusk
obfusk / verify-apk.sh
Last active December 30, 2024 15:51
verify-apk.sh
#!/bin/bash
set -euo pipefail
apksigner verify -v --print-certs "$@" 2>&1 \
| ( grep -av '^WARNING: META-INF/.* not protected by signature' || true ) | cat -v
@obfusk
obfusk / README.md
Last active December 27, 2024 06:54
baseline.profm not deterministic