obsidianx / 3dstools Goto Github PK
View Code? Open in Web Editor NEWTools for extracting and packing resources found in 3DS games
Tools for extracting and packing resources found in 3DS games
When I Rebuild ANY bffnt font, and I test, its offset is always has error.
https://puu.sh/tDoxm/69ce96b4bd.png
Test Game is Picross 3D ROUND 2(both U and J)
and one korean game : Corps Party BloodCovered 3DS
I attach some fonts that i got error here
Corps Party (KOR) : https://puu.sh/tDoHg/31f76c68a6.bffnt
PICROSS 3D ROUND 2(JPN) : https://puu.sh/tDoI0/bd1c01e71e.bffnt
PICROSS 3D ROUND 2(USA) : https://puu.sh/tDoIo/d462b94cb6.bffnt
thanks :)..
I noticed you haven't put a license on this. Would it be okay if I used some of this code in one of my projects?
When runniny msbt.py with python2, I get the following error on a EU_English menu_msbt.lz (which is effectively a MsgStdBn/MSBT file) which is part of the european 3DS Home Menu:
Traceback (most recent call last):
File "msbt.py", line 624, in <module>
msbt.to_json(args.json)
File "msbt.py", line 189, in to_json
json.dump(output, open(filename, 'w'), indent=2, sort_keys=True, ensure_ascii=False)
File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode character u'\ue073' in position 9: ordinal not in range(128)
This character is within the Unicode Private Use Area and shows the 3DS home menu icon (e.g. displayed on the physical home menu button of each 3DS) when displayed on a 3DS.
After that error, the output .json looks like this:
{
"strings": {
"base_2b_cancel": [
"Back"
],
"base_2b_newmake": [
"Create"
],
"create_bu": [
"Save Data Backup"
],
"dat_bu_notitle": [
"Could not display"
],
"dat_bu_sub0": [
"Select a save location."
],
"dat_dlg_bu_brkn": [
"The backup data management\ninformation is corrupted.\nWould you like to create the\ninformation again?\n\u000e\u0001",
"\u0002UBackup data titles may not be\ndisplayed properly afterwards.\u000f\u0001",
""
],
"dat_dlg_bu_cr0": [
"The saved backup data\nwill be overwritten.\n\nIs this OK?"
],
"dat_dlg_bu_cr1": [
"Saving data...\n\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_cr1_jan": [
"Saving data...\n\nDo not remove the microSD\ncard or turn off the power."
],
"dat_dlg_bu_cr1_sac": [
"Saving data...\n\nDo not remove the microSD\ncard or turn off the power."
],
"dat_dlg_bu_cr2": [
"Saved.\n\nSaved backup data can be\nrestored or deleted via\nData Management in the\nSystem Settings."
],
"dat_dlg_bu_crerr": [
"Data could not be saved."
],
"dat_dlg_bu_crng": [
"Failed to create backup data\nmanagement information."
],
"dat_dlg_bu_ining": [
""
],
"dat_dlg_bu_iniok": [
""
],
"dat_dlg_bu_init": [
""
],
"dat_dlg_bu_mkext": [
"Creating save data backup\nmanagement information...\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_mkext_jan": [
"Creating save data backup\nmanagement information...\n\u000e\u0001",
"\u0002ZDo not remove the microSD card\nor turn off the power.\u000f\u0001",
""
],
"dat_dlg_bu_mkext_sac": [
"Creating save data backup\nmanagement information...\n\u000e\u0001",
"\u0002ZDo not remove the microSD card\nor turn off the power.\u000f\u0001",
""
],
"dat_dlg_bu_nosav": [
"There is no save data that can\nbe backed up."
],
"dat_dlg_bu_re1": [
"Restoring backup data...\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_re1_jan": [
"Restoring backup data...\nDo not remove the microSD\ncard or turn off the power."
],
"dat_dlg_bu_re1_sac": [
"Restoring backup data...\nDo not remove the microSD\ncard or turn off the power."
],
"dat_dlg_bu_re2": [
"The save data has been\nrestored from the backup."
],
"dat_dlg_bu_re3": [
"The save data has been\nrestored from the backup.\n\n\u000e\u0001",
"\u0002UThe restored backup data\nhas been deleted.\u000f\u0001",
""
],
"dat_dlg_bu_reerr": [
"The save data could not be\nrestored from the backup."
],
"dat_dlg_bu_unsup": [
""
],
"dat_dlg_sd_full": [
"There is not enough free\nspace on this SD Card."
],
"dat_dlg_sd_full_jan": [
"There is not enough free\nspace on this microSD card."
],
"dat_dlg_sd_full_sac": [
"There is not enough free\nspace on this microSD card."
],
"dat_no_backup": [
"There is no backup data."
],
"lau_1b_badge_plt": [
"Place Badges"
],
"lau_1b_icon_big": [
"Enlarge Icons"
],
"lau_1b_icon_small": [
"Shrink Icons"
],
"lau_1b_make_folder": [
"Create Folder"
],
"lau_1b_ok": [
"OK"
],
"lau_1b_petit_open": [
"HOME Menu Settings"
],
"lau_1b_start": [
"Open"
],
"lau_1b_unwrap": [
"Unwrap"
],
"lau_2b_close": [
"Close"
],
"lau_2b_delete": [
"Stop"
],
"lau_2b_folder_name": [
"%d (New Folder)"
],
"lau_2b_folder_noname": [
"(No name)"
],
"lau_2b_folder_open": [
"Open"
],
"lau_2b_folder_setting": [
"Settings"
],
"lau_2b_manual": [
"Manual"
],
"lau_2b_property": [
"View Details"
],
"lau_2b_restart":
When I was about to change the font file of Splatoon, using this script by the following command
python.exe -xf GambitMain.bffnt
It gives me no error, it worked fine, but the extracted sheets (images) are not okay.
It's almost pink-purple here. So is there a way to fix it?
GambitMain.zip
Using with pypng 0.0.19
I've tried using bflim.py to convert PNG to BFLIM, but it returns this error:
IndexError: list index out of range
Sorry for my bad English first.
I'm hacking Yoshi's Wooly World. When I pack the png, I get a struct error:
py -3 bflim.py -c B293EF93-org.png new.bflim
Traceback (most recent call last):
File "bflim.py", line 835, in <module>
bflim.save(args.bflim_file)
File "bflim.py", line 297, in save
FLIM_UNKNOWN2, FLIM_MULTIPLIER, FLIM_UNKNOWN3)
struct.error: argument for 's' must be a bytes object
Hey! i'm trying to extract a Super Mario 3D World font file and I'm getting an error that says: No module named png. Any ideas why this happens?
C:\Users\Lare\Desktop\3dstools-master>bffnt.py -x MarioFont64.bffnt
Traceback (most recent call last):
File "C:\Users\Lare\Desktop\3dstools-master\bffnt.py", line 9, in <module>
import png
ImportError: No module named png`
Hi! Your tools are wonderful. But could you support bffnt for Fatal Frame: Maiden of Black Water game, please? Thanks! It will be awesome with me!
Currently trying to get msbt.py
to work. Problems so far:
Invalid header magic bytes: b'MsgStdBn' (expected MsgStdBn)
. Fixed by replacing MSBT_MAGIC = 'MsgStdBn'
with MSBT_MAGIC = b'MsgStdBn'
Invalid file size reported: 1614020608 (OS reports 13408)
Weird but doesn't seem fatalTraceback (most recent call last):
File "/home/v/Downloads/msbt.py", line 624, in <module>
msbt.to_json(args.json)
File "/home/v/Downloads/msbt.py", line 164, in to_json
label_lists = self.sections['LBL1']['data']
KeyError: 'LBL1'
Stuck with this one right now. Changing 'LBL1'
to b'LBL1'
doesn't help.
When runniny msbt.py with python2, I get the following error on chinese, japanese and korean variants of the menu_msbt.lz (which is effectively a MsgStdBn/MSBT file) files which of the respective regional 3DS Home Menus. Example error for one of those regions:
Traceback (most recent call last):
File "msbt.py", line 624, in <module>
msbt.to_json(args.json)
File "msbt.py", line 189, in to_json
json.dump(output, open(filename, 'w'), indent=2, sort_keys=True, ensure_ascii=False)
File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-13: ordinal not in range(128)
After that error, the output .json looks like this:
{
"strings": {
"lau_1b_make_folder":
I can't seem to be able to use bcfnt.py. I tried typing "python bcfnt.py" in my cmd but it says:
"Traceback (most recent call last):
File "directory of the file", line 9, in
import png
ModuleNotFoundError: No module named 'png'"
I can't seem to find instructions in the readme for it either
i would love it if i could convert bcfnt to bffnt, or at least extract json and font data from bcfnt like bffnt.py does for bffnt files
I have a font file for which bffnt fails to produce valid pngs. The resulting images contain many 8x8 blocks as expected, but the colours are all incorrect. Incidentally, I have to force the version to be 4 in code to allow it parse successfully. The file is correctly decoded by BFFNTtoGTX.bms. Font file attached.
turbo_messageFontOutline_50.zip
When runniny msbt.py with python2, I get the following error on a german menu_msbt.lz (which is effectively a MsgStdBn/MSBT file) which is part of the european 3DS Home Menu:
Traceback (most recent call last):
File "msbt.py", line 624, in <module>
msbt.to_json(args.json)
File "msbt.py", line 189, in to_json
json.dump(output, open(filename, 'w'), indent=2, sort_keys=True, ensure_ascii=False)
File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 12: ordinal not in range(128)
This character is ü
, one of the letters used in german.
After that error, the output .json looks like this:
{
"strings": {
"base_2b_cancel":
PS C:\3dstools> python ./bffnt.py -xf Caption_00.bffnt
Traceback (most recent call last):
File "C:\3dstools\bffnt.py", line 1234, in
bffnt.extract(args.ensure_ascii)
File "C:\3dstools\bffnt.py", line 341, in extract
writer.write(file_, png_data)
File "C:\Users\Fyred\AppData\Local\Programs\Python\Python311\Lib\site-packages\png.py", line 668, in write
nrows = self.write_passes(outfile, check_rows(rows))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Fyred\AppData\Local\Programs\Python\Python311\Lib\site-packages\png.py", line 703, in write_passes
return self.write_packed(outfile, rows)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Fyred\AppData\Local\Programs\Python\Python311\Lib\site-packages\png.py", line 738, in write_packed
for i, row in enumerate(rows):
File "C:\Users\Fyred\AppData\Local\Programs\Python\Python311\Lib\site-packages\png.py", line 658, in check_rows
raise ProtocolError(
png.ProtocolError: ProtocolError: Expected 2048 values but got 4096 values, in row 0
E:\website\WiiU\tools\3dstools-master\3dstools-master>sarc.py -xf Parts.arc
Invalid filename:
Hash: 0x0 (expected 0x75a5b6)
SARC archive is invalid
Can you add "wiiu nes remix Pack "to extract and pack .arc files to support?
thank you
attachment is "nes remix pack" orgin files.
layout.zip
I'm trying to extract 2 .bffnt file with bffnt.py (need to add more chars), and I get this error:
E:\Jogos\Tools\3DS Data Tools\3dstools-master>bffnt.py -xf FOT-PopJoy_Std.bffnt
Traceback (most recent call last):
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 1232, in <module>
bffnt.read(args.file)
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 149, in read
self._parse_header(data[:FFNT_HEADER_SIZE])
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 550, in _parse_header
print('Unknown version: 0x%08x (expected 0x%08x)' % (version, VERSION))
^^^^^^^
NameError: name 'version' is not defined
E:\Jogos\Tools\3DS Data Tools\3dstools-master>bffnt.py -xf MARIO-OutlineL.bffnt
Traceback (most recent call last):
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 1232, in <module>
bffnt.read(args.file)
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 149, in read
self._parse_header(data[:FFNT_HEADER_SIZE])
File "E:\Jogos\Tools\3DS Data Tools\3dstools-master\bffnt.py", line 550, in _parse_header
print('Unknown version: 0x%08x (expected 0x%08x)' % (version, VERSION))
^^^^^^^
NameError: name 'version' is not defined
Same error to both files.
Hello I'm trying to use the bflim tool, but I obtain this error
Traceback (most recent call last):
File "E:\pruebas\STG\pruebas\bflim.py", line 836, in
bflim.load(args.create)
File "E:\pruebas\STG\pruebas\bflim.py", line 273, in load
for row in list(pixels):
File "build\bdist.win32\egg\png.py", line 1427, in iterstraight
File "build\bdist.win32\egg\png.py", line 1656, in iterdecomp
File "build\bdist.win32\egg\png.py", line 1629, in iteridat
png.ChunkError: ChunkError: I/O operation on closed file
What version of png.py are you using?
Thanks
Hello, when trying to use bffnt.py to extract some bffnt files from the Wii U version of Zelda Breath of the Wild, I get the following errors in Linux.
Unknown version: 0x00000003 (expected 0x04000000)
When trying under windows I am getting the following error
Invalid FFNT magic bytes: b'FFNT' (expected FFNT)
Would it be possible to update bffnt.py to handle these newer BFFNT files?
Tried in latest python 2 and 3 versions.
python 2(7.18):
Traceback (most recent call last):
File "bflim.py", line 836, in <module>
bflim.load(args.create)
File "bflim.py", line 273, in load
for row in list(pixels):
File "C:\Python27\lib\site-packages\png.py", line 1610, in iter_bytes_to_values
for row in byte_rows:
File "C:\Python27\lib\site-packages\png.py", line 1654, in iter_straight_byte_rows
for some_bytes in byte_blocks:
File "C:\Python27\lib\site-packages\png.py", line 2236, in decompress
for data in data_blocks:
File "C:\Python27\lib\site-packages\png.py", line 1874, in iteridat
raise ChunkError(e.args[0])
png.ChunkError: ChunkError: I/O operation on closed file
python3(.11.3):
Traceback (most recent call last):
File "D:\romhack stuff\tools\3dstools-master\bflim.py", line 836, in <module>
bflim.load(args.create)
File "D:\romhack stuff\tools\3dstools-master\bflim.py", line 273, in load
for row in list(pixels):
^^^^^^^^^^^^
File "C:\Python3\Lib\site-packages\png.py", line 1545, in _iter_bytes_to_values
for row in byte_rows:
File "C:\Python3\Lib\site-packages\png.py", line 1587, in _iter_straight_packed
for some_bytes in byte_blocks:
File "C:\Python3\Lib\site-packages\png.py", line 2194, in decompress
for data in data_blocks:
File "C:\Python3\Lib\site-packages\png.py", line 1826, in iteridat
type, data = self.chunk(lenient=lenient)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python3\Lib\site-packages\png.py", line 1399, in chunk
data = self.file.read(length)
^^^^^^^^^^^^^^^^^^^^^^
ValueError: read of closed file
When runniny msbt.py with python2, I get the following error on a US_English menu_msbt.lz (which is effectively a MsgStdBn/MSBT file) which is part of the american 3DS Home Menu:
Traceback (most recent call last):
File "msbt.py", line 624, in <module>
msbt.to_json(args.json)
File "msbt.py", line 189, in to_json
json.dump(output, open(filename, 'w'), indent=2, sort_keys=True, ensure_ascii=False)
File "/usr/lib/python2.7/json/__init__.py", line 190, in dump
fp.write(chunk)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u203b' in position 17: ordinal not in range(128)
This character is ※
(reference mark symbol)
After that error, the output .json looks like this:
{
"strings": {
"base_2b_cancel": [
"Back"
],
"base_2b_newmake": [
"Create"
],
"create_bu": [
"Save-Data Backup"
],
"dat_bu_notitle": [
"Could not display"
],
"dat_bu_sub0": [
"Select a save location."
],
"dat_dlg_bu_brkn": [
"The backup-data management\ninformation is corrupted.\nWould you like to create the\ninformation again?\n\u000e\u0001",
"\u0002UBackup-data titles may not be\ndisplayed properly afterward.\u000f\u0001",
""
],
"dat_dlg_bu_cr0": [
"The saved backup data\nwill be overwritten.\n\nIs this OK?"
],
"dat_dlg_bu_cr1": [
"Saving data...\n\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_cr1_jan": [
"Saving data...\n\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_cr1_sac": [
"Saving data...\n\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_cr2": [
"Saved.\n\nSaved backup data can be\nrestored or deleted via\nData Management in\nSystem Settings."
],
"dat_dlg_bu_crerr": [
"Data could not be saved."
],
"dat_dlg_bu_crng": [
"Failed to create backup-data\nmanagement information."
],
"dat_dlg_bu_ining": [
""
],
"dat_dlg_bu_iniok": [
""
],
"dat_dlg_bu_init": [
""
],
"dat_dlg_bu_mkext": [
"Creating backup-data\nmanagement information...\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_mkext_jan": [
"Creating backup-data\nmanagement information...\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_mkext_sac": [
"Creating backup-data\nmanagement information...\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_nosav": [
"There is no save data that can\nbe backed up."
],
"dat_dlg_bu_re1": [
"Restoring backup data...\nDo not remove the SD Card\nor turn off the power."
],
"dat_dlg_bu_re1_jan": [
"Restoring backup data...\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_re1_sac": [
"Restoring backup data...\nDo not remove the microSD\nCard or turn off the power."
],
"dat_dlg_bu_re2": [
"The save data has been\nrestored from the backup."
],
"dat_dlg_bu_re3": [
"The save data has been\nrestored from the backup.\n\n\u000e\u0001"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.