The dates are correct when creating a mac binary.
Example from the binary Majestic:
Majestic: MacBinary II, inited, busy, Thu Nov 9 05:09:33 1995, modified Thu Nov 9 05:11:55 1995, creator 'PJ93', type application, 23374400 bytes "Majestic" , at 0x164aac0 486640 bytes resource
There were two problems:
- glob pattern only found directories:
Now it returns both directories and files.
- top level dir was included in the punyencoding
\x81 is used as a control character to denote a special char.
\x81 was encoded put in the end result twice because of a missing elif.
Includes unittest fix.
Enable punyencoding of directory names in mac mode.
A refactor of the code to handle punyencoding in mac mode.
It's now a two step process:
- first collect the resource forks into macbinaries and
- second punyencode recursively all files and directories
The dumper companion now support dumping mac_japanese isos. MachFS
expects encodes everything in mac_roman. For mac_japanese we decode it
as mac_roman and then encode it ourselve.
`dumper-companion.py iso --japanese --punycode path/to/iso path/to/dir`
- A conversion table and code was added: taken from:
https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/JAPANESE.TXT
- file_to_macbin takes an encoded filename to allow for both mac_japanse
and mac_roman encodings.
- punyfication is now an explicit option when dumping isos
- mac mode: show which file's attributes can't be read
- mac mode: use exit code 1 when bailing
- implement exit codes for all modes
- fix spelling mistake
- sort imports, python once first, then external packages
- refactor: use os.path.join only once per file
`dumper-companion.py mac [--punycode] directory` will recursively look
for resourceforks and encode them inplace as macbinary.
When `--punycode` is enabled it will encode filenames in punycode.
This is a MacOS only feature.
Original dumper-companion.pl script encoded \x81 to \x81\x79\x81.
- added test to check for correct behavior
- refactored escape string to handle this special case
Adds the `str` subcommand:
./dumper-companion.py str STRING
punyencode the string STRING
./dumper-companion.py str --stdin
punyencode stdin
The HFS iso dumper is moved into it's own subcommand:
./dumper-companion.py iso -e encoding input_iso output_dir
It reads an hfs formatted iso and extracts its contents. The output
follows two rules:
- A file is saved as macbinary when it has a resource fork and
- filenames with non-ascii chars are converted into a punycode variant.
An initial verson of this python script was created by: @eientei on
discord.