This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
zipentry=META-INF/version-control-info.textproto | |
commit_from_zip() { | |
unzip -p -- "$1" "$zipentry" | grep revision | grep -Eo '[0-9a-f]+' | tail -1 | |
} | |
url="${1:-}" | |
if [ -z "$url" ]; then | |
read -r -p 'url> ' | |
url="$REPLY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Unicode { | |
public static void main(String[] args) { | |
String foo = "🏳️⚧️"; | |
for (String x : foo.split("")) { | |
System.out.println(x.codePointAt(0)); | |
} | |
System.out.println("---"); | |
int n = foo.codePointCount(0, foo.length()); | |
for (int i = 0; i < n; ++i) { | |
int j = foo.offsetByCodePoints(0, i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[flake8] | |
ignore = E501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <flx@obfusk.net> | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
import os | |
import struct | |
import zipfile | |
from dataclasses import dataclass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.der | |
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.security.cert.CertificateFactory | |
import java.security.cert.X509Certificate | |
def i = new FileInputStream(args[0]) | |
def cert = CertificateFactory.getInstance("X.509").generateCertificate(i) | |
println cert.getIssuerX500Principal().getName(javax.security.auth.x500.X500Principal.CANONICAL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -pi -e 's/\b(\d+)\b/$1 - 1/e' file-with-numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import dataclasses | |
import json | |
import sys | |
import repro_apk.binres as binres | |
data = {} | |
for apkfile in sys.argv[1:]: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.android.apksig.ApkSigner | |
import com.android.apksig.apk.ApkUtils | |
import com.android.apksig.internal.apk.v1.V1SchemeVerifier | |
import com.android.apksig.util.DataSource | |
import com.android.apksig.util.DataSources | |
def f = new RandomAccessFile(args[0], "r") | |
def apk = DataSources.asDataSource(f, 0, f.length()) | |
def zipSections = ApkUtils.findZipSections(apk) | |
def cdRecords = V1SchemeVerifier.parseZipCentralDirectory(apk, zipSections) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <flx@obfusk.net> | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
from elftools.elf.elffile import ELFFile # type: ignore[import-untyped] | |
from elftools.elf.sections import NoteSection # type: ignore[import-untyped] | |
class Error(Exception): |
NewerOlder