[MH4U/MHX] ROM Hacking Guide

Discussion in '3DS - ROM Hacking, Translations and Utilities' started by dasding, May 4, 2016.

  1. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    Welcome Hunters,

    this is my guide to modding Monster Hunter 4 and X to your desire. I will provide tools especially for textures, sfx/music and extracting/repacking arc files. The tools work with MHX and MH4U. But at some steps you will have to choose the correct script for the respective game.
    So let's get started.

    Video showing steps 3-5:
    Warning: Spoilers inside!


    You will need:
    • Python 2.7.11 (Don't worry, no heavy console-fu needed, at least for the HANS method)
    • Pillow (Used for Texture Stuff)
    • Harddrive with at least ~10GB free disk space.
    • A 3DS with either CFW OR Homebrew (for MH4U)
    • A 3DS with CFW (for MHX)

    1. Prerequisites
    Download and install Python, Pillow and MH Mod Tools from the following links.
    Install Python to the default location C:\Python27!

    Downloads:
    Download MH Mod Tools (rev06)

    64 Bit
    Download Python 2.7.11 (64 Bit)
    Download Pillow (64 Bit)

    32 Bit
    Download Python 2.7.11 (32 Bit)
    Download Pillow (32 Bit)

    2. Acquire your romfs.bin
    There are two ways to get your romfs.bin.
    a) extract it from an decrypted cia of your game.
    b) dump it from your cartridge with braindump.


    3. Extract romfs.bin and arc files

    All you need to do for this step is place your romfs.bin (it has to be named like this) in the MH Mod Tools folder next to the .bat files (You should make sure that there is no space in the path to your modfolder).
    Then double click 1_extract_romfs.bat.
    Wait for it to finish.
    Then double click on 2_extract_arcfs.bat.
    This step will take some time. arcfs consists of ~100.000 files.

    4. Modifying Files
    After Step 3 you will end up with 2 folders: romfs and arcfs. Basically romfs contains all uncompressed files of the game and arcfs are all the compressed files (which are nearly all) extracted. e.g. you will find battle BGM in romfs, but SFX in arcfs.

    4.1 Modifying Sound Files
    Sound files have the filesuffix .mca .

    4.1.1 Convert .mca to .wav
    Find an .mca file in romfs or arcfs and copy it to the main folder (next to the .bat files). Then drag & drop it onto 3_mca2wav.bat. After the black window closes you will end up with a wav file which you can play back in any common media player.

    4.1.2 Convert .wav to .mca
    To inject your own music into the game you have to convert it to a .mca file. If you have your music not in .wav format use something like audacity to convert it to .wav first. Then copy your .wav file in the main folder (next to the .bat files) and drag & drop it onto either 3_wav2mca_mh4.bat or 3_wav2mca_mhx.bat, depending on which game you're currently modifying. After the black window closes you will end up with your .mca file which you can then use to replace any .mca in romfs or arcfs.

    4.2 Modifying Textures
    Texture files have the filesuffix .tex .

    4.2.1 Convert .tex to .png
    Find an .tex file in arcfs and copy it to the main folder (next to the .bat files). Then drag & drop it onto 3_tex2png.bat. After the black window closes you will end up with a single .png and a .meta file depending on the texture there could also be a second png file with the alpha/reflection channel. Don't mess with the .meta file you will need it to convert the png back to .tex. Now you can edit your .png in your favorite image editor.

    4.2.2 Convert .png to .tex

    To convert the modified .png back to a .tex drag & drop it onto 3_tex2png.bat. After the black window closes you will end up with your modified .tex which you can then use to replace the original one.
    Attention:
    Due to preserving the best quality the encoding will autmatically be uncompressed, so the modified file will be multiple times bigger than the original. If you want to control the compression you will have to learn console-fu and have look at the .bat and tools/textool.py.

    4.3 Modifying any File
    Just open files of interest to you in your favorite hex editor and start hacking ;)

    5. Repack Everything
    After you did all your modifications and replaced the original files in arcfs and romfs it's time to repackage everything.
    For this just double click on 4_repack_arcfs_mh4.bat or 4_repack_arcfs_mhx.bat, depending on the game your modifying. This Step will take a lot of time due to all files being recompressed and packaged.
    After the black window closes double click on 5_repack_romfs.bat and you will end up with a new romfs file called modded_romfs.bin.

    6. Getting your mod on your 3ds
    6.1 HANS (only MH4U)

    Copy your modded_romfs.bin onto your SD card under:
    /HANS/00126100.bin for EU copy
    /HANS/00126300.bin for US copy
    /HANS/0011D700.bin for MH4G copy
    Then start your game with HANS and your modded romfs enabled.

    6.2 CIA repack (MH4U and MHX)
    6.2.1 Vanilla CIA
    Use your modded_romfs.bin to repackage the vanilla .cia of your game.


    6.2.2 Update CIA [Advanced Users]
    Before extracting the arcfs and modifying the files you'll want to remove all files you don't plan to modify from the romfs folder. Next you also have to extract the romfs of the update CIA you plan to repack and merge it with the romfs folder (overwrite already existing files). Now you can continue with extracting the arcfs, modifying files, and repackaging the arc files. Then rebuild the romfs folder into a romfs.bin and repackage it into your update cia.

    6.3 LayeredFS (MH4U and MHX v1.00) [Advanced Users]
    You actually don't need the modded_romfs.bin, you just need to copy the modified files from romfs onto your SD card with the configured path of the layeredfs plugin. Files you modified in the arcfs folder got repacked into .arc files. You have to figure out which one under romfs/arc/ contains your modified file and you only need to copy that one or just copy it all.

    7. Done, enjoy your mod!
    I hope my tutorial was understandable and of help to you. If you managed to put a cool mod together don't hesitate to reply here, pm me or tweet me screenshots of your work. I would appreciate that a lot!

    Also tell me if you have suggestions on improving this guide or the tools.

    8. Bonus
    I ripped the Attack on Titan Deviljho Texture from the MHXR Smartphone game for you.
    Try to mod it into your game ;)

    Textures
    Result Screenshots


    Changelog
    rev05
    * fixed an issue with mca2wav
    * updated wav2dsp

    Credits
    @Asia81 for his guide on CIA repackaging
    @dnasdw for 3dstool
    @moghedien for etc1 decoding
    @Gericom for etc1 encoding

    @jackoalan for dsp encoding
    Anon1 and Anon2 you're the best ;)
     
    Last edited by dasding, Apr 15, 2017


  2. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    348
    203
    Oct 15, 2014
    New Zealand
    New Zealand
    Awesome, almost surprised it took this long, moment HANS came out I toyed with getting a weapon over from MH3U to MH4U for the hell of it, didn't have much luck glad to see someone has worked out some modding :)
     
  3. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    If you look at the upload date of the titanjho screenshots you will see i had all the tech stuff done for some while ;). I just never did get around to making it non-developer friendly and writing it all down.
     
    bomigoton and Chiejina like this.
  4. Phemeto

    Phemeto GBAtemp Regular

    Member
    119
    58
    Jan 21, 2016
    United States
    Dude this is awesome, I would love for people to do retextured monsters for custom updates.

    On the music replacement, is there a quality/size limit that the game will accept? I planned on changing all the sound tracks to orchestrated versions
     
  5. Froster

    Froster Your Music Producer

    Member
    363
    243
    Sep 6, 2015
    Italy
    that MIDI sequencer
    Woah gonna try this right now!
    I waited a long time to mod MH4U or MHX...and now that moment has come!
     
  6. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    That's a nice idea. 44khz stereo is guaranteed to be ok. it will be compressed to 4 bits per sample and should generally sound fine (~360kb/s bitrate). there is no hard length limit afaik but you shouldn't go overboard due to ram limitations ;)
     
  7. SackThing101

    SackThing101 Member

    Newcomer
    29
    5
    Aug 17, 2015
    United States
    Alright, assume I'm a god and can extract all the textures and stuff easily.

    Would it be possible to put in the original Monster Hunter textures and music and stuff, dump the scripts and apply them to either MH4U or MHX, and make a 3D remake of the original Monster Hunter?

    And what about replacing maps. Is that impossible?
     
  8. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    Doing a remake of the original MH isn't that easy for multiple reasons. The engine of the first MH should be completely different and even if it were the same you most definetly have to not only hack the files but also the program code ;)

    Model swaps work. But with some caveats, e.g. if you exchange one monster with another the animations are still the same and the result looks alot glitchy. If you would replace entire maps the waypoints for monsters will not match etc.

    Another thing i uploaded rev03 of the tools there were problems with spaces in the path which should now be no problem and also the mh4u mca extracting was messed up and is now fixed.
     
  9. SAIVEN

    SAIVEN Member

    Newcomer
    44
    7
    Feb 6, 2016
    It's really awesome

    I want to extract, repack Monster Hunter 3U

    Can I use this tool?

    If possible, can you update the MH3U tools?
     
  10. Februarysn0w

    Februarysn0w School Idol Festival

    Member
    1,193
    512
    Oct 31, 2014
    Mino city Osaka
    thank you for your awesome tools. here is my bgm mod video.

    cakwsFW175 and layerfs.

    video Deleted for copyright.

    happy lovelive.
     
    Last edited by Februarysn0w, Jun 29, 2016
    justln likes this.
  11. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    nice :yay: happy it worked out for you :D
     
    Februarysn0w likes this.
  12. Incarni

    Incarni Newbie

    Newcomer
    1
    0
    Jun 10, 2016
    Gambia, The
    Awesome, awesome, awesome! Can't wait to change the background music of Deviljho and my other favourite beasts to some cool Linkin Park and Bring me the Horizon songs!
    However, I do have a question. Since you can hack basically everything with these tools I was wondering if it is possible to modify MHX so it is in English? Kinda like the patches for the PSP games. And if you can, do you know someone who has done a translation? I mean, yeah, the game will be released in Europe in the next month but I already have it since a few months on my japanese 3DS and like in MH4 I am struggling with the Japanese. :P
     
  13. DarkSynopsis

    DarkSynopsis GBAtemp Fan

    Member
    348
    203
    Oct 15, 2014
    New Zealand
    New Zealand
  14. homefryguy

    homefryguy Member

    Newcomer
    28
    2
    Apr 8, 2016
    United States
    Has anyone tried anything crazy like adding new monsters or areas to the game or is it only possible to replace textures and music? I really wished Monster Hunter had more rom hacks.
     
  15. Phemeto

    Phemeto GBAtemp Regular

    Member
    119
    58
    Jan 21, 2016
    United States
    I'm still failing and working on audio replacement, but I'm sure it will pick up when Gen is out
     
  16. PhillardThePanda

    PhillardThePanda Newbie

    Newcomer
    2
    0
    Jun 28, 2016
    United States
    Hi, I'm new to programming and the like. When ever I use the first .bat file, it flashes a command prompt I can't read it's so fast. Nothing happens. Help please? I'm using the 64-bit version with windows.
     
  17. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    you can execute them manually from the commandline, then the window won't disappear. But when the window flashes instantly there is probably an error with your romfs.bin (either non-existant or still encrypted maybe?)
     
  18. APitou

    APitou Newbie

    Newcomer
    4
    1
    Jan 31, 2016
    Canada
    This is fantastic. Question, will it work with Generations?

    Also, could this tool be used to extract monster models? I've been wanting to get a high quality Mizutsune model to print.
     
  19. dasding
    OP

    dasding GBAtemp Regular

    Member
    244
    787
    Oct 25, 2015
    Gambia, The
    yes they work with generations. You will get the models (.mod files). for converting you should use the mod importer plugin for blender by @moghedien: github
     
  20. Drak0rex

    Drak0rex GBAtemp Advanced Maniac

    Member
    1,904
    696
    Oct 12, 2014
    United States
    Does anyone know if any significant changes were made from X to Gen? Were there any weapon/armor omissions/alterations that would warrant a further translation of X (should be easy now that it's officially translated)? Or would it be easier to add back anything that was cut from X?