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): |
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 sys | |
import zipfile | |
# Usage: zipdup.py ZIPFILE ENTRY_NAME ENTRY_DATA | |
zfile, zentry, data = sys.argv[1:] | |
with zipfile.ZipFile(zfile, "w") as zf: | |
info = zipfile.ZipInfo(filename=zentry) | |
zf.writestr(info, data) |
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: AGPL-3.0-or-later | |
import fnmatch | |
import os | |
import struct | |
import sys |
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.io.File; | |
import java.io.IOException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.cert.CertificateEncodingException; | |
import java.security.cert.X509Certificate; | |
import java.util.List; | |
import com.android.apksig.ApkVerificationIssue; | |
import com.android.apksig.ApkVerifier; | |
import com.android.apksig.apk.ApkFormatException; |
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 zipfile | |
def test(filename): | |
_orig_EndRecData = zipfile._EndRecData | |
eocd_offset = None | |
def _EndRecData(fh): | |
endrec = _orig_EndRecData(fh) | |
if endrec: |
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 hashlib | |
import os | |
import re | |
import struct | |
import zipfile |
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: AGPL-3.0-or-later | |
import argparse | |
import json | |
import os | |
from typing import Any, Dict |
NewerOlder