View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000090 | file | General | public | 2019-07-04 19:12 | 2019-12-31 03:12 |
Reporter | Pysis | Assigned To | christos | ||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | assigned | Resolution | open | ||
Product Version | 5.37 | ||||
Summary | 0000090: Adds Nintendo Console Wii U/Switch file formats | ||||
Description | Adds header detailed output support for these formats: - Yaz0 - BYAML - BFRES - BLWP - STAT - BARS - BFSAR - SARC Lightly Documents these formats "clearinghouse" style: - BTSND - RPL/RPX - BFMA - (Non-archive) ARC Tested with local sample files and Bats-core tests: - tests/data/A-1.00.autoplacement_forbid.agstats - tests/data/MapTex_A-0_0.bfres - tests/data/yaz0.sarc - tests/data/AkkareLabBgm.bars - tests/data/_DistanceView_Dynamic.byml - tests/data/DummySound.bfsar - tests/data/yaz0/_DistanceView_TeraTree.sblwp - tests/data/yaz0/AncientArrow.sbitemico - tests/data/yaz0/MapOpen_00.sbmapopen - tests/data/yaz0/MapTex_A-0_0.sbmaptex - tests/data/yaz0/5000000000.grass.extm.sstera - tests/data/yaz0/_DistanceView_Dynamic.smubin - tests/data/yaz0/Demo109_1.sbreviewtex - tests/data/yaz0/A-1.00.sstats - tests/data/yaz0/Rollpict001.sbstftex - tests/data/A-1.00_Clustering.blwp - (tests/_setup.sh) - tests/stat.bats - tests/bfres.bats - tests/yaz0.bats - tests/sarc.bats - tests/byml.bats - tests/bfsar.bats - tests/blwp.bats - tests/bars.bats ~ fileutil -v file-5.37 magic file from /usr/local/Cellar/libmagic/5.37/share/misc/magic | ||||
Tags | No tags attached. | ||||
|
|
|
From the file headers: grep -oPiz '\n\n#-+\n([^\n]+?)\n#[^\n]+?\n' \ console \ | grep -oPiz '\n\n#-+\n([^\n]+?)\n' \ | grep -oPiz '\w.+?\n' \ | sed 's|\x0||g' \ > reference/file_current_console_magics.txt Only from the section headers: grep -oPiz '\n\n#-+\n([^\n]+?)\n#\n' \ console \ | grep -oPiz '\w.+?\n' \ | sed 's|\x0||g' \ > reference/file_current_console_magic_sections.txt |
|
Some of these are too weak (too few bytes of magic and the magic is text) so they would be produce spurious matches to text files. We should add these commented out. These days the minimum magic is around 32 bits. Can you restructure (where possible) the magic to look like: 0x0 string SARC >0x6 beshort 0xFEFF SARC archive file, BOM Big Endian, >> use nintendo_sark >0x6 beshort 0xFFFE SARC archive file, BOM Little Endian, >>0 use nintendo_sark 0 name nintendo_sark !:ext sarc >0x4 beshort x Header length %xh, >0x8 belong x File size %d bytes, >0x0C belong x Data offset %xh, >0x10 beshort x Version Number %d This way you need SARK and a valid BOM for a match. What do you think? |
|
Sorry for the delay. I saw that note, but I believe those 4 ASCII letters do technically suffice. I see what you mean as an alternative, and it seems ok, but the way I have it just seems cleaner and done. |
|
|
|
The advantage of my approach is that it makes the effective magic 8 bytes... I.e. it requires SARC\xfe\xff or SARC\xff\xfe before a match instead of just SARK. |
|
But they're fine as is and if people confuse an ASCII and proprietary binary file using this then they have a bigger problem. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-07-04 19:12 | Pysis | New Issue | |
2019-07-04 20:20 | Pysis | File Added: file.2019-07-04.19-11.gz | |
2019-07-04 20:20 | Pysis | File Added: file.tests.2019-07-04.19-19.gz | |
2019-07-07 17:32 | Pysis | File Added: file.2019-07-07.10-42.gz | |
2019-07-07 17:32 | Pysis | File Added: file.2019-07-07.13-32.gz | |
2019-07-07 17:32 | Pysis | Note Added: 0003258 | |
2019-07-21 09:29 | christos | Assigned To | => christos |
2019-07-21 09:29 | christos | Status | new => assigned |
2019-07-21 09:35 | christos | Status | assigned => feedback |
2019-07-21 09:35 | christos | Note Added: 0003262 | |
2019-08-23 02:18 | Pysis | Note Added: 0003286 | |
2019-08-23 02:18 | Pysis | Status | feedback => assigned |
2019-08-23 02:35 | Pysis | File Added: file.2019-22-08.22-33.gz | |
2019-09-12 16:02 | christos | Note Added: 0003304 | |
2019-10-05 22:50 | Pysis | Note Added: 0003312 |