koukdw / Aquarium_tools

11 stars 0 forks source link

binu8_dump.py crushed #1

Closed CHAOS-mnt closed 1 year ago

CHAOS-mnt commented 1 year ago

Have you tested binu8_dump.py with the Scripts extracted from the Update(v1.0.2) NSP file? I am tring to dump the updated Scirpt files, but the program always crushed when processing aqu_01_09.binu8. Can you see what the problem is? I run the script with Python 3.10.7 on Windows 10. And everything works fine with the origin game nsp.

Traceback (most recent call last):
  File "C:\...\Extracted_NSP\37d7942a02060af1baaae56921e497ff_NCA\romfs\Update\binu8_dump.py", line 66, in <module>
    main()
  File "C:\...\Extracted_NSP\37d7942a02060af1baaae56921e497ff_NCA\romfs\Update\binu8_dump.py", line 56, in main
    str_count = byte2int(src.read(4))
  File "C:\...\Extracted_NSP\37d7942a02060af1baaae56921e497ff_NCA\romfs\Update\binu8_dump.py", line 17, in byte2int
    long_tuple=struct.unpack('<L',byte)
struct.error: unpack requires a buffer of 4 bytes
koukdw commented 1 year ago

mhh can you send me the file, it works on my side with the 1.0.2 update files. Try dumping with yuzu

First guess, it's probably the same problem some other guy had. For some reason either his dumping method or he did something with the files, the file had the byte order mark at the beginning which made my hacky script not work.

But i can't know without the files

CHAOS-mnt commented 1 year ago

I used the Install Files to NAND to load the update nsp(I'm not sure if that's the right way to dump those files), then I dumped RomFS. After that I compared the output folder with romfs folder which I extracted from the original game file with hactool, and it turns out they are completely same, there is no file from the update nsp.

Anyway I will upload the aqu_01_09.binu8 file which I extracted from the update nsp with hactool, I also tried to compared it with the one from original game file in some hex editor, and I think the strcuture looks quite different but I don't have the knowknowledge to analyze it.

aqu_01_09.zip

koukdw commented 1 year ago

It doesn't look like a binu8 files there's something wrong with your files

Look at how my aqu_01_09 from the Update > Script folder look like aqu_01_09.zip

I basically dumped like you, I updated with Install Files to NAND using the 1.0.2 nsp then i dumped the ROMFS using yuzu.

CHAOS-mnt commented 1 year ago

Well, after a few attempts I figured out what's wrong.

I used hactool to dump the update nsp with --onlyupdated because I just want the updated files. But somehow some of the dumped files are wrong. And if I use hactool or yuzu to dump all the files, there isn't any problem. It's just that I didn't notice the Update folder, I thought the updated files would just overwrite the files in the original directory.

Now I can focus on the translation work, thank you for your help.