Skip to content

Instantly share code, notes, and snippets.

@ciciplusplus
ciciplusplus / convert_gbmp_to_zip.py
Created April 26, 2025 16:53
A dubios python script to convert GBMP to a valid ZIP
#!/usr/bin/env python3
"""
convert_gbmp_to_zip.py
Reads an input file 1 bytes at a time and checks 4 bytes chunks.
If a 4-byte chunk equals 0x47 42 4D 50 (“GBMP”),
it is replaced with 0x50 4B 03 04 (“PK\x03\x04”) in the output.
The output is written next to the original file, but with a .zip suffix.
Afterwards the script checks the resulting file is a valid ZIP archive.
"""