Skip to content

Commit

Permalink
added RIFX
Browse files Browse the repository at this point in the history
  • Loading branch information
59de44955ebd committed Feb 19, 2023
1 parent 9a9010c commit 39e61eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import zlib

DEV_NULL = 'nul' if sys.platform == 'win32' else '/dev/null'

def unpack(f, dest_dir=None, do_decompile=False):
if not os.path.exists(f):
Expand Down Expand Up @@ -48,6 +49,7 @@ def unpack(f, dest_dir=None, do_decompile=False):
b'Joy!', # D10- mac projector
b'\xCA\xFE\xBA\xBE', # D11+ Projector Resource
b'\xCE\xFA\xED\xFE', # D11+ Projector Intel Resource
b'RIFX' # data fork of classic mac app
]
for m in MAGIC_MACOS:
if magic == m:
Expand Down Expand Up @@ -224,15 +226,15 @@ def unpack_projector (exe_file, output_dir, do_decompile=False):

def rebuild(fn):
dest_file = fn + '.tmp'
os.system(f'ProjectorRays --rebuild-only "{fn}" "{dest_file}"')
os.system(f'ProjectorRays --rebuild-only "{fn}" "{dest_file}" >{DEV_NULL}')
if os.path.isfile(dest_file):
os.unlink(fn)
os.rename(dest_file, fn)

def decompile(fn):
dest_file, ext = os.path.splitext(fn)
dest_file += ('_decompiled.cst' if ext == '.cxt' or ext == '.cct' else '_decompiled.dir')
os.system(f'ProjectorRays "{fn}" "{dest_file}"')
os.system(f'ProjectorRays "{fn}" "{dest_file}" >{DEV_NULL}')

def get_filename(fn):
''' cross-platform, extracts filename of Windows, POSIX or Mac OS path '''
Expand Down

0 comments on commit 39e61eb

Please sign in to comment.