From 22c19bbfdf86e1d2883fe7739ea4ab63d110d2e3 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 19 Sep 2021 19:43:44 +0800 Subject: [PATCH] Flattener: allow raw resource fork --- FlattenSegmentedMacAppForDisassembler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/FlattenSegmentedMacAppForDisassembler.py b/FlattenSegmentedMacAppForDisassembler.py index 55d0bc5..7322d91 100755 --- a/FlattenSegmentedMacAppForDisassembler.py +++ b/FlattenSegmentedMacAppForDisassembler.py @@ -17,7 +17,11 @@ args.rtype = args.rt.partition('=')[0].encode('mac_roman') args.rid = int(args.rt.partition('=')[2]) with open(args.src, 'rb') as f: - resources = list(macresources.parse_rez_code(f.read(), original_file=f.name)) + d = f.read() + if f.name.endswith('.rdump'): + resources = list(macresources.parse_rez_code(d, original_file=f.name)) + else: + resources = list(macresources.parse_file(d)) resources = [r for r in resources if r.type == args.rtype and r.id >= args.rid] resources.sort(key=lambda r: r.id)