This commit is contained in:
Matthieu Jolimaitre 2025-06-17 15:30:36 +02:00
commit a70defc85f
7 changed files with 83 additions and 0 deletions

30
decompr.py Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env -S python3
import subprocess
import sys
def main():
[_, input] = sys.argv
input_tar = input.replace(".cprmt", ".tar")
output = input_tar.replace(".tar", "")
print("Decompressing '" + input + "' into '" + output + "'.")
input_fd = open(input, "rb")
output_tar_fd = open(input_tar, "wb")
byte_index = 0
while True:
read = input_fd.read(1024)
if len(read) == 0:
break
for byte in read:
if byte_index == 0:
pass
else:
output_tar_fd.write(bytes([byte]))
byte_index += 1
byte_index %= 5
subprocess.Popen(["tar", "xf", input_tar]).wait()
print("Done.")
if __name__ == "__main__": main()