RELEASE Smash Ultimate (Partial) Data.arc Extractor/Inject Tool

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by FIX94, Nov 25, 2018.

  1. FIX94
    OP

    FIX94 Global Moderator

    Global Moderator
    21
    Dec 3, 2009
    Germany
    ???
    So I think I have an idea of what happened, this may be a pretty big encoding bug on their part, I think they actually intended all files to be around 100kbps, because the blocks I recovered at the end of that file actually do appear to be at that bitrate, but for some reason, who knows, due to some encoder bug or game decoding issue, that data was then overwritten by a lower quality stream of only 67kbps, and this bit at the end with the last bit of the song may just be a leftover of what it was originally going to be quality wise, which is pretty sad if my theory here is correct... When comparing the bit at the end and a theoretical "overall" bitrate of the file, if it was all used that is, they would work out to be about the same.
    edit: oh also its 64kbps to be perfectly exact here, because each block starts with 8 "header" bytes, subtracting those works out to exactly 64kbps cbr. The actually intended size was actually 96kbps cbr but it was seemingly overwritten at some point...
     
  2. Cozimo

    Cozimo Newbie

    Newcomer
    1
    Aug 15, 2017
    United Kingdom
    Ah, I thought the source may have been higher due to the questions of potentially higher bitrate and the low opus bitrate being just a container issue.

    A real shame, but it's not like it's terrible quality anyway. Well, thanks for your help!

    — Posts automatically merged - Please don't double post! —

    Wow, so there's literally nothing more that can be done, the files at the source are 2hat they are. Unless by some miracle there's a patch that sort of 'opens up' the game data a bit more or fixes said bug.
     
  3. Small Kat

    Small Kat PC addict

    Member
    4
    May 24, 2015
    United States
  4. FIX94
    OP

    FIX94 Global Moderator

    Global Moderator
    21
    Dec 3, 2009
    Germany
    ???
    Just did some more work on the main file structures, finally understood how linking works inside the arc, lots of files seem to basically have shortcuts to other files, so the same file can be in different folders, seems to be used quite a bunch. Also now it can also extract files that are in the last 1.3gb of the file which before was not possible because those files actually were referenced in a different way for some reason. So now I think it should be possible to actually extract everything if you know the filenames, still gotta find some way to get those names I guess :P
     
  5. Mat37

    Mat37 GBAtemp Advanced Fan

    Member
    5
    Dec 3, 2016
    France
    Does it matter ?
  6. FIX94
    OP

    FIX94 Global Moderator

    Global Moderator
    21
    Dec 3, 2009
    Germany
    ???
  7. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    what does the build.bat do?
     
  8. Notex

    Notex Advanced Member

    Newcomer
    4
    Mar 21, 2017
    Australia
    Compiles the application.
     
  9. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    is there any way we can inject the data.arc

    — Posts automatically merged - Please don't double post! —

    can we inject the data.arc file?
     
  10. FIX94
    OP

    FIX94 Global Moderator

    Global Moderator
    21
    Dec 3, 2009
    Germany
    ???
    if you know the name of the file and you run the tool, it'll display the absolute offset in the data.arc so thats I guess somewhat helpful if the filesize of the file you want to replace is the same or smaller.

    Also I've been cracking away at one particular filename the last 2 days using my own little crc32 forcer tool cause I wanted to figure out where some things are stored and it finally finished, so now I know that for example the intro movie and cutscenes are located in:
    ui/param/database/ui_movie_db.prc
    and those are in full paths already, with stream:/ prefix and everything,
    the music tracks are located in:
    ui/param/database/ui_bgm_db.prc
    those are just the base names, you still have to build them like:
    stream:/sound/bgm/bgm_<name_from_that_list>.nus3audio
    also the other movie files that show off how moves work and stuff are located in:
    ui/param/database/ui_technic_db.prc
    which again, you have to build them like:
    stream:/movie/technique/<name_from_that_list>.webm

    Also theres various other databases like ui_chara_db.prc, ui_clear_getter_db.prc, ui_spirit_db.prc, ui_howtoplay_db.prc, ui_item_db.prc, ui_popup_db.prc, ui_rule_db.prc and ui_stage_db.prc in the ui/param/database folder, and those arent all of them yet either, thats just how much I cracked into once I understood the base pattern.

    With my tool programmed to just extract everything, I get a folder of over 135 thousand files so far, so there is still a LOT to understand and document :P
     
  11. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    Yeah it's a pretty neat tool (Good job FIX94) I've been diving in the hashstring.txt file made by smashNXtools and I've been at least 2 hours or so looking for links texture files. As i was searching and hunting for it i got ideas from other hashes for eg. Link's bow texture is.
    fighter/Link/model/...(cant Remember lol)
    So i guessed it to be this
    fighter/link/model/body/c00/def_link_001_col.nutexb.
    And in a heartbeat it worked, for other links color alts is the the same thing but replace c00 with c01 or c02 and so on. Those hashes wasn't present in the hashstrings.txt

    — Posts automatically merged - Please don't double post! —

    I'm just waiting for killzXgaming to fix an issue in his switchToolbox for nutexb format. I can export the nutexb file to multiple image types (Obviously the DDS file is the main format packed inside the nutexb) but i can't repack or replace the image back into the nutexb because the program gives me an Unhandled exception error. Until killzXgaming fixes the issue i can't do any texture editing.

    — Posts automatically merged - Please don't double post! —

    — Posts automatically merged - Please don't double post! —

    yeah i can see the offset where the file is located, do i replace that offset with modded file in a hex editor?
     
  12. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    FIX94 how do i replace the extracted files? I can see the offset the file is located but i don't know how to inject it back to the data.arc.
     
  13. minibar

    minibar Member

    Newcomer
    2
    Oct 23, 2018
    United States
    I didn't realize anyone was looking at the hashstrings.txt file. I've committed an updated version to GitHub
     
  14. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    It really helps to find out the filenames but not everything is there on the txt file. I've been looking for links texture file and it wasn't available in the txt file, i just managed to find it by a lucky guessing. But now i just need to know how to inject the file back in the data.arc. I can see the offset where the file is packed but when i open the extracted file in the hex editor it's completely different HEX strings and obviously i can't just copy the entire HEX and paste it on the files offset in the data.arc. If you know FIX94 how to inject the file into the data.arc please tell me how.
     
  15. FIX94
    OP

    FIX94 Global Moderator

    Global Moderator
    21
    Dec 3, 2009
    Germany
    ???
    I'll look into adding a replace function tomorrow I think.
     
  16. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia
    Thanks FIX94

    — Posts automatically merged - Please don't double post! —

    you're doing an amazing job keep up the good work.
     
  17. Deobulakenyo

    Deobulakenyo Advanced Member

    Newcomer
    3
    Oct 8, 2018
    Philippines
    Can you share these XBC2 mods with us? Thanks
     
  18. minibar

    minibar Member

    Newcomer
    2
    Oct 23, 2018
    United States
    94% of the file paths are in the txt file. The file you're looking for isn't one of these? https://pastebin.com/raw/cZQ7CRmz

    There's not much to share. I quickly hacked a function together to replace existing files in the archive. https://github.com/Thealexbarney/XbTool/blob/master/XbTool/XbTool/Xb2/FileArchive.cs#L202
     
  19. hamdan91

    hamdan91 Member

    Newcomer
    2
    Jul 11, 2018
    Australia

    Wow! most of these files are not in the txt file
     
  20. minibar

    minibar Member

    Newcomer
    2
    Oct 23, 2018
    United States
    I think you didn't grab the new list when I said I updated it.
     
Loading...