ROM Hack The World Ends with You - Final Remix - Extracting the soundtrack

evilwombat

Member
OP
Newcomer
Joined
Sep 17, 2018
Messages
12
Trophies
0
Age
37
XP
111
Country
United States
Hello. I haven't been able to find where to find the soundtrack for TWEWY - Final Remix, so here's a guide to dump it from the NSP for the time being. This requires knowledge of basic Nintendo Switch reverse-engineering (knowing how to follow community instructions should be enough, but some of the key-dumping stuff is relatively involved), and some familiarity with Python. I tested this on a Linux system, but "in theory" you ought to be able to do this on Windows, if you have the right Python stuff installed. But, I haven't tried this.

You will need:
  • A (legally-obtained) copy of the game's .NSP file. I am afraid cannot help you here.
  • hactool for your platform
    Grab this from here: https://github.com/SciresM/hactool
  • The key file to give to hactool. This has been called "prod.keys" or "keys.ini" or "keys.txt". There have been tools out there that will help you dump the keys from your console. I am afraid I cannot give you mine.
  • Python installed on your system (python3 I think)
  • UnityPack installed on your system (or downloaded and installed locally - see my hacky guide below).
    Grab from here: https://github.com/HearthSim/UnityPack
    You may be able to use some other kind of Unity unpacker (I imagine they exist for Windows) but your mileage may vary
  • (Optional) vorbiscomment installed on your system (sudo apt install vorbiscomment), or google for the Windows version.
  • (Optional) a script to rename the tracks to something useful, and to give them useful metadata
    Grab from: (see attached)
Steps:
  1. Use hactool to extract the NSP file into its sections:
    Run:
    hactool -k path/to/keys.txt -x --intype=pfs0 path/to/game.nsp --outdir=twewy_extract
    You should end up with a directory called "twewy_extract" which contains a few files.

  2. Use hactool to further extract the ROMFS section of the game. Go into the "twewy_extract" directory and find the biggest .NCA file in there. This is the ROMFS file.
    Run:
    hactool -k path/to/keys.txt -x --romfsdir=twewy_romfs path/to/romfs_file.nca
    (replace 'romfs_file.nca' with the long filename of the ROMFS file from above. It will have a bunch of numbers in the name)
    You should end up with a directory called "twewy_romfs", which should contain one or two more directories (which, in turn, contain a ton of stuff).

  3. Grab the unity-encoded soundtrack.
    Go into twewy_romfs/Data/StreamingAssets/Assets/sounds/bgm/ and you should see a bunch of .unity3d files. These are the music tracks, packed in the unity3d format. Copy these someplace.

  4. Set up UnityPack. (If you have some other Unity extractor that works, skip this step and just use that instead).
    If you're cool with UnityPack, try to use your system's python3 package manager to install 'unitypack'.
    If that fails, just grab it from https://github.com/HearthSim/UnityPack
    In either case, find the unitypack/enums.py file of whatever instance of UnityPack you are using, and edit it, to add the following line at the bottom:
    NintendoSwitch = 38
    NOTE: Make sure this line is indented the same way as the lines above it (eight spaces)! Python very much cares about whitespace.

    If installing UnityPack from github:
    * You'll probably need to also install its dependencies via pip.
    * I forget what the full list is, but I want to say you'll want to pip3 install decrunch fsb5 IntEnum lz4, (and whatever else it says it's missing when you go to run unityextract).
    * After cloning UnityPack, I had to run the following steps to keep it from barfing. This basically "installs" UnityPack to a local directory, and then tells Python where to find it (so that you don't have to install the whole thing in your system python directory). This may be due to me having all my python stuff outdated, though. Your mileage may vary.
    cd UnityPack
    mkdir -p local/lib/python3.4/site-packages
    export PYTHONPATH=local/lib/python3.4/site-packages
    python3 setup.py install --prefix local
    And then to actually run unityextract, I had to run:
    export PYTHONPATH=local/lib/python3.4/site-packages
    python3 ./local/bin/unityextract
    * If facing python problems, refer to https://xkcd.com/1987/ for what you've gotten yourself into ;). This was by far the most frustrating part of the whole process

  5. Use unityextract to unpack the .unity3d files that you grabbed in step 3.
    Run:
    unityextract --all --out sountrack/ path/to/your/unity3d/files/*.unity3d
    You will end up with a directory called "soundtrack" containing a bunch of .ogg files. This is the soundtrack!

  6. Optionally, copy the attached twewy_soundtrack.py file into the "soundtrack" directory and run it. This will use the "vorbiscomment" utility to rename them to something more useful, and to assign metadata.
    If you're on Windows, you might need to edit the script (use Notepad++) to replace "vorbiscomment" with "vorbiscomment.exe" in the two obvious places, though I have not tried this.

  7. Consider buying the soundtrack when it comes out...
Have fun, and good luck!
 

Attachments

  • twewy_soundtrack.zip
    3.8 KB · Views: 318
Last edited by evilwombat,
  • Like
Reactions: FutureAudio

FutureAudio

Active Member
Newcomer
Joined
Jul 10, 2018
Messages
35
Trophies
0
Age
39
XP
156
Country
United States
I have a few of the osts for this game. And sadly, like silent hill 3, all the tracks in the game are NOT featured on the soundtrack...(!?)

Thanks!
 

Deleted member 514389

GBA Connoisseur
Member
Joined
Dec 24, 2019
Messages
510
Trophies
0
Location
the toolshed
Website
f.ls
XP
753
Country
Germany
Scratch Step 4 onwards and use this:
https://sourceforge.net/projects/utinyripper/

Thanks for your amazing guide.

For whomever has trouble:
Make sure to use the prod.keys =>renamed to => keys.ini via this

Also, for getting the titlekey, use the nand the game is installed in and extract the keys via Lockpick_RCM
=> use the games titleid to idenfiy the "titlekey" from the titles.keys.


Tried to make some sense of your py script... in a list manner for whom it concerns:
01_Underground F01.ogg

02 Calling F02.ogg

03_Imprinting F03.ogg

04_Game_Over F04.ogg

05_Detonation F05.ogg

06_SHIBUYA F06.ogg

07_Fighting_for_Freedom F07.ogg

08_Long_Dream Bz01.ogg

09_Hybrid Bz02.ogg

10_Someday Bz03.ogg

11_OWARI-HAJIMARI Bz04.ogg

12_Psychedelic Bz05.ogg

13_Hybrid Bz06.ogg

14_NOISY_NOISE Bz07.ogg

15_Satisfy B01.ogg

16_Make or Break B02

17_Give_Me_All_Your_Love B03.ogg

18_Twister B04.ogg re_B04.ogg

19_Someday B05.ogg

20_Ooparts B06.ogg", "re_B06.ogg

21_Twister-remix B04E_R.ogg

22_Dancer_in_the Street B08.ogg

23_Junk Garage B09.ogg

24_Slam_Brothers B10.ogg

25_Let_s_Get_Together B11.ogg

26_Twister E01.ogg

27_Amnesia E02.ogg

28_Forebode E04.ogg

29_Rush_Hour E05.ogg

30_Despair E06.ogg

31_It's So Wonderful title.ogg

32_Economical Shoppers S01.ogg

33_Black_Market S02.ogg

34_It_Is_Fashionable S03.ogg

35_Calling_(1960s) F02_R.ogg

36_Three_Minutes_Clapping F03E.ogg

37_Three_Minutes_Clapping_(Live) F03E_L.ogg

38_Game_Over_(Busy_Dizzy_and_Lazy) F04.ogg

39_Dejavu F07E.ogg

40_Dejavu_(Discoteque) F07E_R.ogg

41_Jump_Over_Yourself F08N.ogg

42_Someday_(Unplugged) Bz03_R.ogg"

43_OWARI-HAJIMARI Bz04E.ogg

44_Twister_(Gang Mix) Bz05E.ogg

45_Twister Bz05E_R.ogg

46_Hybrid_(New born) Bz06_R.ogg

47_Transformation Bz07E.ogg

48_Transformation_(Transformed) Bz07E_R.ogg

49_TATAKAI Bz08N.ogg

50_The One Star B01E.ogg

51_Emptiness B02E.ogg

52_Make_or_Break_(Black Box) B02_R.ogg

53_Give_Me_All_Your_Love_(All my love) B03_R.ogg

54_Twister_(OriginalVer) B04_R.ogg

55_OOParts B06_R.ogg

56_Long_Dream_(1980s) BZ01_R.ogg

57_TWISTER_(KINGDOM MIX) Kh01.ogg

58_CALLING_(KINGDOM MIX) Kh02.ogg

59_SOMEDAY_(KINGDOM MIX) Kh03.ogg

60_RUNAWAY ending.ogg

61_MMM m001.ogg re_m001.ogg

62,_TWISTER m002.ogg

63_DTM_(Crossover) m003.ogg

64_Twister_(Crossover) m004.ogg

65_Twister_(Gang Remix) m005.ogg

66_Twister_() m006.ogg

67_Three_Minutes_Clapping(NoClapping) m007.ogg

68_Long Dream_(Parallel_Mix) m008.ogg

69_Dejavu_(SanctuaryMix) m009.ogg

70_SHADOW New01.ogg

71_____ New02.ogg

72_Twister_(Final Remix) New03.ogg

73_Revelatio New04.ogg

74_Revelation_-Flower New05.ogg", "New05.ogg"),

75_March_On_(JP) New06.ogg

76_March On New07.ogg

77_Hybrid_-_ignis_fatuus_(The_Death_March) New08.ogg

78_Calling New09.ogg

79_(The_Death_March) New10.ogg

80_RUN_AWAY_(The_Death_March) New11.ogg

81J_Jump_Over_Yourself_(papapayapa) New12.ogg

82_Someday_(KINGDOM_MIX_JP Ver.)(Someday) New13.ogg

83_Twister_(UNION_MIX) New14.ogg

84_Owari-Hajimari_(x-tended_ver) New15.ogg

85_Twister_(Novoiski_Remix) New16.ogg

86_Make_or_Break_(remix_for_qanchis) New17.ogg

87_Satisfy_(Galaxy Dub) New18.ogg

88_Calling_(HI Remix) New19.ogg

89_Twister_(HI Remix) New20.ogg

90_CALLING_-_KINGDOM_MIX_(Live_Ver) New21.ogg

91_Twister_(Live_Ver) New22.ogg

92_Twister_-_Crossover_(LiveVer) New23.ogg

93_Make_or_Break_(Mysterious Remix) re_B04E_R.ogg
 
Last edited by Deleted member 514389,
General chit-chat
Help Users
  • No one is chatting at the moment.
    K3N1 @ K3N1: https://youtube.com/shorts/PArWUK0WyDQ?feature=share