Skip to content

Instantly share code, notes, and snippets.

@uyjulian
Created March 23, 2026 04:33
Show Gist options
  • Select an option

  • Save uyjulian/aa49a2af52e5155750f8f9c20e7221f0 to your computer and use it in GitHub Desktop.

Select an option

Save uyjulian/aa49a2af52e5155750f8f9c20e7221f0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# This program fixes file header in place for BDJ.czf (referenced by libcvm.so/modified phoneME)
# such that it can be extracted by standard tools.
import sys
import zipfile
with zipfile.ZipFile(sys.argv[1], "a") as myzip:
myzip.comment = b"Fixed CZF"
for zfi in myzip.infolist():
if zfi.compress_type == 16:
zfi.compress_type = zipfile.ZIP_STORED
if zfi.compress_type == 24:
zfi.compress_type = zipfile.ZIP_DEFLATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment