View Issue Details

IDProjectCategoryView StatusLast Update
0000090fileGeneralpublic2019-12-31 03:12
ReporterPysis Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Product Version5.37 
Summary0000090: Adds Nintendo Console Wii U/Switch file formats
DescriptionAdds 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
TagsNo tags attached.

Activities

Pysis

2019-07-04 20:20

reporter  

Pysis

2019-07-07 17:32

reporter   ~0003258

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
file.2019-07-07.13-32.gz (27,358 bytes)

christos

2019-07-21 09:35

manager   ~0003262

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?

Pysis

2019-08-23 02:18

reporter   ~0003286

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.

Pysis

2019-08-23 02:35

reporter  

christos

2019-09-12 16:02

manager   ~0003304

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.

Pysis

2019-10-05 22:50

reporter   ~0003312

But they're fine as is and if people confuse an ASCII and proprietary binary file using this then they have a bigger problem.

Issue History

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