Last active
March 24, 2018 03:18
-
-
Save mk-fg/fb8d028f7bc9e541e40e90d0e38e884a to your computer and use it in GitHub Desktop.
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 lz4.block | |
import struct, pathlib, sys | |
file_src = sys.argv[1] | |
file_dst = sys.argv[1] + '.dec' | |
data = pathlib.Path(file_src).read_bytes() | |
size, = struct.unpack('=I', data[4:8]) | |
payload = data[16:] | |
payload_dec = lz4.block.decompress(payload, size) | |
pathlib.Path(file_dst).write_bytes(payload_dec) |
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
% python3 ../dec.py UI/Icons/bmc_dome_spires_shine.tga | |
% file UI/Icons/bmc_dome_spires_shine.tga.dec | |
UI/Icons/bmc_dome_spires_shine.tga.dec: Targa image data - RGB 50 x 50 x 32 - top |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment