Created
July 1, 2022 17:00
-
-
Save FelixWolf/92981e15accdec66a719dae01cd3fbf6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env python3 | |
| import struct | |
| import io | |
| from libfurc import archive | |
| def unpack(data): | |
| data.seek(-10, 2) | |
| if data.read(2) != b"FC": | |
| print("Not a furcadia installer!") | |
| exit(1) | |
| size, = struct.unpack("<I", data.read(4)) | |
| data.seek(-size - 10, 2) | |
| data = io.BytesIO(data.read(size)) | |
| rch = archive.RCHFile.open(data) | |
| for file in rch.files: | |
| if file.name.lower() == "lev02.ds": #"furcadia.exe": | |
| print(file.read()) | |
| if __name__ == "__main__": | |
| import argparse | |
| parser = argparse.ArgumentParser(description='Unpack a furcadia installer.') | |
| parser.add_argument('furcadia', metavar="furcadia.exe", nargs="?", default='furcadia.exe', | |
| type=argparse.FileType('rb'), help='Input installer') | |
| parser.add_argument('output', nargs="?", default=None, | |
| help='Output folder (default: furcadia_<version>)') | |
| args = parser.parse_args() | |
| unpack(args.furcadia) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment