Skip to content

Error unpacking new BFLAN Nintendo Switch #17

Open
@Migushthe2nd

Description

@Migushthe2nd

I don't want to overload you with issues, but here is another error.
The common.szs (another system file that contains info just like ResidentMenu.szs) also comes with an animation folder. Some of these animations can be opened in Wexos and extracted by your kit, like SystemColorFader_In.bflan, but others, like SystemColorFader_Color.bflan, result in an error. This so far only happens with files that (I assume) contain color information: BgNml_Color.bflan, BlurBg2_Color.bflan, CntrIndicatorS_Color.bflan, SystemColorFader_Color.bflan etc.
SystemColorFader_In.bflan:
https://drive.google.com/open?id=1YaYKFYTffGlzWl7kkRnddsEwO7aUiWm_

--------SystemColorFader_Color.bflan--------
No compression
BFLAN file found
Extracting...
Traceback (most recent call last):
  File "3DSkit.py", line 249, in <module>
    result = main(args, opts)
  File "3DSkit.py", line 169, in main
    extract_files(filename, args.big, args.format, args.verbose, opts)
  File "3DSkit.py", line 112, in extract_files
    unpack.extract(filename, file, format, endian, verbose, opts)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\__init__.py", line 16, in extract
    unpacker = cls(*args)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\utils.py", line 18, in __new__
    return self.main(*args, **kwargs)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 41, in main
    self.extract_sections(ptr)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 63, in extract_sections
    method(ptr)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 131, in readpai1
    data = self.unpack_from(pai1_TAG, self.file, tagpos)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 101, in unpack_from
    unpacked, ptr = _unpack(stct, data, offset, byteorder, refdata)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 58, in __new__
    return ins.main(*args, **kwargs)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 317, in main
    return self.unpack_file(stct)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 415, in unpack_file
    final.append([self.unpack_file(el.stct)[0] for i in range(count)])
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 415, in <listcomp>
    final.append([self.unpack_file(el.stct)[0] for i in range(count)])
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\rawutil.py", line 467, in unpack_file
    final += struct.unpack(substruct, subdata)
struct.error: unpack requires a buffer of 4 bytes

Idk if Wexos' error will add anything, but I'll include it anyway
image

Some files return a bit different error, like FooterBtn_TextColor.bflan
FooterBtn_TextColor.bflan:
https://drive.google.com/open?id=1viUh1Xuy_WFCtLbvjWfljpKfbBaBt8Qm

--------FooterBtn_TextColor.bflan--------
No compression
BFLAN file found
Extracting...
Traceback (most recent call last):
  File "3DSkit.py", line 249, in <module>
    result = main(args, opts)
  File "3DSkit.py", line 169, in main
    extract_files(filename, args.big, args.format, args.verbose, opts)
  File "3DSkit.py", line 112, in extract_files
    unpack.extract(filename, file, format, endian, verbose, opts)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\__init__.py", line 16, in extract
    unpacker = cls(*args)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\util\utils.py", line 18, in __new__
    return self.main(*args, **kwargs)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 41, in main
    self.extract_sections(ptr)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 63, in extract_sections
    method(ptr)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 148, in readpai1
    tagentry['type2'] = self.gettype(type2, type)
  File "S:\Mijn Drive\Things\NSW\Themes\Very nice theme\tools\3DSkit\unpack\BFLAN.py", line 161, in gettype
    el = eval('%s_types[type]' % tagtype)
ValueError: source code string cannot contain null bytes

And here's Wexos' error for that one:
image

Edit: I'm adding some more info

I have executed the unpack command for every file.
Here's a hastebin: https://hastebin.com/direwirose.rb
I noticed that not every color file, BgNml_Color.bflan and BlurBg2_Color.bflan, results in an error when unpacking.
Oh whoops, I forgot that unpacking BFLAN's is only partially supported and they cannot be repacked yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions