ROM Hack [MH4U/MHX] ROM Hacking Guide

Vangormel

Member
Newcomer
Joined
Aug 24, 2018
Messages
5
Trophies
0
XP
110
Country
United States
sorry i assume it's the tools fault and with that i cant help. i use commandline tools for my stuff, like ctrtool, 3dstool and makerom.

Code:
all: extract

content.0000.*: original.cia
   bin/ctrtool --contents=content original.cia

romfs.bin: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --romfs romfs.bin

exefs.bin: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --exefs exefs.bin

ncchheader.bin: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --header ncchheader.bin

exh.bin: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --exh exh.bin

logo.bcma.lz: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --logo logo.bcma.lz

plain.bin: content.0000.*
   bin/3dstool -x -v -t cxi -f content.0000.* --plain plain.bin

romfs: romfs.sentinel
   @test || true

romfs.sentinel: romfs.bin
   bin/3dstool -x -v -t romfs -f romfs.bin --romfs-dir romfs
   @touch romfs.sentinel || true

exefs: exefs.bin
   bin/3dstool -x -v -t exefs -f exefs.bin --exefs-dir exefs --header exefsheader.bin
   bin/3dstool -u -v -f exefs/code.bin --compress-type blz --compress-out exefs/code.bin

extract: romfs exefs


rebuild: romfs exefs ncchheader.bin exh.bin logo.bcma.lz plain.bin
   bin/3dstool -z -v -f exefs/code.bin --compress-type blz --compress-out exefs/code.bin
   bin/3dstool -c -v -t exefs -f exefs.bin --exefs-dir exefs --header exefsheader.bin
   bin/3dstool -c -v -t romfs -f romfs.bin --romfs-dir romfs
   test -e plain.bin && bin/3dstool -c -v -t cxi -f contents.0000.00000000 --header ncchheader.bin --exh exh.bin --logo logo.bcma.lz --plain plain.bin --exefs exefs.bin --romfs romfs.bin || true
   test -e plain.bin || bin/3dstool -c -v -t cxi -f contents.0000.00000000 --header ncchheader.bin --exh exh.bin --logo logo.bcma.lz --exefs exefs.bin --romfs romfs.bin
   bin/makerom -f cia -o rebuild.cia -content contents.0000.00000000:0:$(INDEX) -ver $(VERSION)

this is how i extract and repack with a Makefile

Trying to learn these tools but not yet able to complete the final step because of the following errors:

[NCCH ERROR] Failed to load ncch aes key
[CIA WARNING] CXI AES Key could not be loaded
Meta Region, SaveDataSize, Remaster Version cannot be obtained

After applying the faulty CIA in Citra, the game has no icon, it's region is Invalid and the game itself ignores CIA entirely when ran. From reading around, this error seems quite common.

For testing purposes, I extracted and repacked your English patch with ctrtool/3dstool and it worked just fine, so it's apparent my romfs additions need to be properly addressed somewhere in the rebuilding process, but I'm not sure how.
 

SuperHunter

New Member
Newbie
Joined
Dec 14, 2018
Messages
1
Trophies
0
XP
57
Country
United States
I'm having some trouble with tex2png.bat. Everything else works just fine.
I can open models in 3ds max no problem but when it comes time to convert the .tex files it doesn't work.
I drag the .tex file onto tex2png.bat and the window flashes and then vanishes instantly.
I tried moving everything onto my C: drive, didn't work.
Re-install pillow and python, didn't work.
Move everything to another computer with only 1 hard drive and has never had python installed on it, install python and pillow, didn't work.
I've tried everything I can think of. Do you guys have any idea what I'm doing wrong?
 

Deniii

Well-Known Member
Newcomer
Joined
Aug 6, 2009
Messages
60
Trophies
1
XP
339
Country
United States
I'm having a problem with "3_png2tex.bat".
Everytime I try to convert a png back to tex, I get the following error:
TypeError: 'int' object has no attribute '__getitem__'

If I convert the png back to tex without doing any modifications to it, it works. But if I do anything to the png, I always get that error.

What am I doing wrong?
 
Last edited by Deniii,

tbsp

New Member
Newcomer
Joined
Dec 20, 2019
Messages
3
Trophies
0
Age
43
XP
93
Country
Canada
Thanks for the tools and the excellent guide!

I've trying to edit some text in MH4U. I've tried using Kuriimu, but the lmd files it saves are much smaller than the original files and freeze the game when the edited strings are encountered.

I can edit the lmd files just fine in a hex editor, but it's not clear how I would adjust the string lengths. I suspect there's a data block earlier in the file describing the various string lengths. Any suggestions for a tool that can edit the files directly, tips on the lmd format used by MH4U, or should I just work through it and decipher the format myself? ;)

Thanks!

Edit: I figured out enough of the format myself to make the edits I'm interested in right now. Any suggestions for how to make sense of the 8 bytes per string near the start of the file would be great though!
 
Last edited by tbsp,

SilveosAlgentum

Member
Newcomer
Joined
Jul 3, 2020
Messages
15
Trophies
0
Age
27
Location
Mexico
XP
63
Country
Mexico
Ugm, does this hack can modify armors to? Because I want past games armors in MHXX, like Qurupeco armor, G-Rank Ceadeus armor, Gogmazios armor, Gobul armor, Jhen Mohran armor, and so on...
 

Slentara1

New Member
Newbie
Joined
Sep 14, 2020
Messages
4
Trophies
0
Age
33
XP
57
Country
United States
@dasding, I want to rip hunter models and a couple pieces of equipment to use with vseeface on monster hunter streams, could this help me and how would I know what models are the ones I need?
 
Last edited by Slentara1,

gnawty

New Member
Newbie
Joined
Mar 6, 2021
Messages
2
Trophies
0
Age
28
XP
38
Country
United States
Hello Fellow Hunters,

I have discovered how to replace one weapon model for another within mhxx (essentially adding weapon transmog to mhxx).

0. You need to make sure you have luma game patching set up on your 3ds, Kuriimu (I just used Karameru), and a hex editing program (I used Flexhex because it has a comparison tool in it).

1. First you need to locate what weapon you are trying to add and which you are trying to replace. For this example I'm replacing Charge blade 25 (Diablos Strongarm) with Charge blade 19 (Akantor C. Blade). I did this by extracting png's tex files until I found what I was looking for.

2. Go the the Romfs folder locate the .arc file of the replacement charge blade. (for me it was under romfs\arc\weapon\w14\019.arc). Copy that into a working folder, and create a backup in case you mess up.

3. Open the target arc file in the hex editor and change the file names:

weapon\w14\gaxe019\gaxe019_BM -> weapon\w14\gaxe025\gaxe025_BM
weapon\common\env_w034_BM no change
weapon\common\env_w000_BM no change
weapon\common\env_w033_BM no change
weapon\w14\gaxe019\blade019 -> weapon\w14\gaxe025\blade025
weapon\w14\gaxe019\blade019 -> weapon\w14\gaxe025\blade025
weapon\w14\gaxe019\sld019 -> weapon\w14\gaxe025\sld025
weapon\w14\gaxe019\sld019 -> weapon\w14\gaxe025\sld025

upload_2021-3-6_22-16-1.png

Here's what one part of the edit looks like. Flexhex has a visual aid, so you can see the char's that the hex represents.

Save the file as [target number].arc. (for me it was 025.arc).

4. Extract the contents of the new arc file using karameru, and open up the .mrl file(s) in the hex editor. Keep karameru open.

From there all you have to do is replace the filename at the top of the .mrl file like this:
upload_2021-3-6_22-19-22.png


Some weapons like charge blade and dual blades have multiple .mrl files, so you have to do it for each one. I've only tested this with charge blade so far.

5. In Karameru replace the .mrl files with the edited ones, and save the file.

6. Place the the file in the target spot on your 3ds. For me it was here:

D:\luma\titles\0004000000197100\romfs\arc\weapon\w14

upload_2021-3-6_22-27-36.png


Now you can larp as your favorite speedrunner!

*I do want to note that for some reason the texture quality is slightly worse than the original weapon. I'm not sure what causes this.

Let me know if you guys are able to get this to work. I've tried importing weapons from mh4u, and that's quite a bit more involved...

Until next time.... Happy Hunting!
 
  • Like
Reactions: Entenboot

gnawty

New Member
Newbie
Joined
Mar 6, 2021
Messages
2
Trophies
0
Age
28
XP
38
Country
United States
So, I figured out how to add mh4u files to mhxx, but the process is a bit more involved. It's not impossible though, and hopefully I can explain in layman terms. It might help if you manage to replace an mhxx weapon with an mhxx weapon first instead of jumping straight into this.

I'm going to assume you have installed everything you need from my previous post, and you have experience of transplanting an mhxx weapon onto an mhxx weapon. As I had to fully understand that process in order to do this process....

0. you need to dump the romfs and arcfs files of mh4g (yes, the japanese version of mh4u I'll refer to it by that name so you don't forget this step!). You get a crash when changing clothes if you do this with mh4u files. There might be crashes elsewhere too, and it's unclear if this guide will work if you don't use that version!

1. Locate the mh4g weapon skin you want and locate the mhxx weapon you would like to replace.

2. Find the .arc file of the mh4g in romfs/data. Check and make sure that the file you want to replace has the same amount of common .tex files used in it. I'm not sure this will work if there's a mismatched common .tex files, so you may want to pick a different weapon skin.

upload_2021-3-7_16-18-48.png

mh4g weapon (I'm using the gogmazios IG for this example)

upload_2021-3-7_16-14-2.png

mhxx weapon (I'm transplanting it onto the ruiner glaive). Note that both have 2 common env .tex's in them.

open up the mhxx target file .arc file in a hex editor and change the common variables to that of the mh4g weapon.
upload_2021-3-7_16-25-15.png


3. Editing the mh4g .tex file
Byte 5 A5 -> A6

4. Editing the mh4g .mod file
Bytes 7C-80 00 00 00 5C 74 -> 80 00 00 00 00

after FF FF... string AND immediate numbers after ie FF 03 00 00 00 01 02
make sure next byte starts with 80 7F 01. Substitute the extra stuff with 0's.

upload_2021-3-7_16-30-18.png

(this is an example of what you need to delete)

Please note that there are sections where they declare values with the mh4g weapon number. You don't have to replace those, and if you do it will cause the "black texture glitch."

And finally in this variable declaration "×í" section (I'm not sure). Substitute the 2 blocks before with 0's. It sounds kind of random, but if you have studied a bunch of mhxx .mod files it would make sense.
upload_2021-3-7_16-32-13.png

This is an example of what needs to be done.

5. The .mrl section.....
This is probably the most tricky section and the most prone to the invisible weapon glitch. If your .mrl section is wrong it either makes the weapon have the mh4g model with a pitch black texture, and will look like this. Any multitude of things could have went wrong, so you might see this texture a lot....

upload_2021-3-7_16-36-40.png

Black texture glitch

Open the .mrl file of the mh4g weapon.

Bytes 10-14
61 AA C1 CE -> BD 0C CA EA

CD spam:
First, make sure that the path is directed toward the right .tex file. Afterward you want to spam "CD" bytes until you get to the "EB 5D 1F 24," "00 00 00 00," or "E4 EB B0 5F" blocks that's when the spam stops. There's usually about 8-10 blocks of "CD CD CD CD" spam. If this doesn't make sense just open any mhxx .mrl file. You'll see what I mean.

upload_2021-3-7_16-39-9.png


There should be 2 "strings" that begin with "E4 EB B0 5F" after the final CD spam:
upload_2021-3-7_16-57-27.png


Block replacement after final CD spam. I'm pretty sure that these are always the same length, and are always changed to the same values regardless of mh4g's initial value. Likewise, if something is safe, then it's always unchanged.

*safe means no change.
E4 EB B0 5F *safe
B6 42 BE 60 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D2 90 13 B8 -> D1 90 13 B8
DE F0 8C 10 -> DD F0 8C 10
08 00 3E 80 -> 08 C0 4D 80
00 00 80 84 *safe

E4 EB B0 5F chain #2
E4 EB B0 5F *safe
A3 34 3D 78 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D1 90 13 B8 -> D2 90 13 B8
DE F0 8C 10 -> DE F0 8C 10
08 60 E1 82 -> 08 C0 BB 82 (08 60 E1 82 + 00 5F DA 00) [use windows calculator in the programmer mode for this. This is the only part that requires some math] You always have to add for this block.

*safe means no change from mh4g -> mhxx.

Áͽ section(s).
This part is also a bit tricky, but luckily every block has the same exact format. Meaning that whatever is changed is always changed, and whatever is unchanged is always unchanged. There's only 2 Áͽ section in the mh4g file I selected, but there may be more than 2 depending on the weapon.

upload_2021-3-7_16-58-41.png

Here's the change log:

01 00 60 12 -> C1 CD BD 12 always
60 00 00 00 *safe
26 B1 A5 16 -> 2B B1 A5 16 always
E1 BE 9D 10 -> C1 CD 9D 10 always
10 01 00 00 *safe
09 11 80 6C *safe
83 00 0D 1A -> C3 CD AD 1A always
01 00 00 00 *safe
A0 F1 06 CD -> AA F1 06 CD always
12 FF BF 10 -> C2 CD BD 10 always
0B 31 6C 7F *safe
0B 31 6C 7F *safe
03 00 10 1A -> C3 CD BD 1A always
02 00 00 00 *safe and then the next one is 05 00 00 00.... etc (regardless it's always safe to not touch!).
A1 61 8E E8 -> AB 61 8E E8 always
03 00 70 1A -> C3 CD 1D 1B always
00 00 00 00 *safe
A7 21 51 C5 -> B1 21 51 C5 always
D3 01 AD 1A -> C3 CD 4D 1B always
03 00 00 00 *safe
AA 81 99 0B -> B4 81 99 0B always
E3 BE ED 1A -> C3 CD 8D 1B always
04 00 00 00 *safe
AE 11 EC 5D -> B8 11 EC 5D always

Here's the other one I had to change:
upload_2021-3-7_17-10-4.png


Finally at the end of the file you have to change one last thing:

upload_2021-3-7_17-11-32.png

26 B1 A5 16 -> 2B B1 A5 16 always
26 B1 A5 16 -> 2B B1 A5 16 always
21 04 00 00 *safe
01 0C 80 49 -> 01 0C C0 4A always

6. after you've completed your .mrl file edits, all you have to do is replace all of the files of the mhxx weapon in Karameru (don't forget the common env files!), and save to your sd card.

The final product should look like this:

upload_2021-3-7_15-58-35.png


Let me know if you are able to get it to work. It's quite the chore just to do one weapon....
 

Attachments

  • upload_2021-3-7_16-11-59.png
    upload_2021-3-7_16-11-59.png
    41.9 KB · Views: 182
  • upload_2021-3-7_16-49-30.png
    upload_2021-3-7_16-49-30.png
    24.5 KB · Views: 168

SAIVEN

Well-Known Member
Newcomer
Joined
Feb 6, 2016
Messages
49
Trophies
0
XP
223
Country
Hello
I am translating the great ace attorney into Korean.
I am also working on changing the character voice to Korean.
Using the tools created by dasding, the conversion and application of the voice was successful, but problems arose.
Conversion of the voice file results in noise at the end.
I tried to solve this problem, but there was a file that caused noise, and there was a file that did not.

The conversion was made to the mhx version, and the special version did not work in the game.

Attach the noisy voice file and the converted file.
https://mega.nz/file/615iFDhB#5wDuOD3d7eB56WleqQ8CuerKHLRDB0tN8JkZAtskxmM

I want to know how to solve it. Plz help me.
 

xScarYx

Active Member
Newcomer
Joined
Mar 24, 2021
Messages
26
Trophies
0
Age
42
XP
512
Country
Germany
Hey, why when I use some characters like "à ù ê ç" the game displays "?". How to fix that please ? Thanks !

Hi, im new to this site and also to RomHacking.
I wanted to play MHXX in my native language and was wondering why nobody (or i was just blind ^^) translated the original or based on your (dasding) work to german. So i deceided to try it and make a German Patch.
After some Hours of experimenting i got a decent result, which runs nice so far on Citra and on my real n3ds.

*edit*
But i have one little problem, its the same problem Regerios encountered. i read every message after his post, but couldnt find any answer to his question.
so i ask again. has anyone solved this problem or is it impossible? in german we have (öäüß etc. which are all ingame as ?)
i can use a workaround like ö=oe etc. but thats a lot of work to change every bit of text ^^


nvm, solved it already. wasnt that hard :)
 
Last edited by xScarYx,
  • Like
Reactions: tbsp

YK-GBA

New Member
Newbie
Joined
Jun 9, 2021
Messages
1
Trophies
0
Age
25
XP
42
Country
United States
Now, I might be retarded, but I can't tell if my directory has any spaces in it, cause I can't get any of these to work, can't extract or convert anything, if I could just get anyone to point me in the right direction, it would be deeply appreciated.
 

Attachments

  • Screenshot 2021-06-09 121453.png
    Screenshot 2021-06-09 121453.png
    116.1 KB · Views: 124

xScarYx

Active Member
Newcomer
Joined
Mar 24, 2021
Messages
26
Trophies
0
Age
42
XP
512
Country
Germany
Now, I might be retarded, but I can't tell if my directory has any spaces in it, cause I can't get any of these to work, can't extract or convert anything, if I could just get anyone to point me in the right direction, it would be deeply appreciated.

i had to use v9 not the latest one to get my stuff extracted and repacked. maybe give it a try
but u can also use kuriimu-v1.0 to manage this stuff.
 
Last edited by xScarYx,

klark231

Well-Known Member
Member
Joined
Jun 25, 2018
Messages
114
Trophies
0
Age
27
XP
605
Country
Philippines
So, I figured out how to add mh4u files to mhxx, but the process is a bit more involved. It's not impossible though, and hopefully I can explain in layman terms. It might help if you manage to replace an mhxx weapon with an mhxx weapon first instead of jumping straight into this.

I'm going to assume you have installed everything you need from my previous post, and you have experience of transplanting an mhxx weapon onto an mhxx weapon. As I had to fully understand that process in order to do this process....

0. you need to dump the romfs and arcfs files of mh4g (yes, the japanese version of mh4u I'll refer to it by that name so you don't forget this step!). You get a crash when changing clothes if you do this with mh4u files. There might be crashes elsewhere too, and it's unclear if this guide will work if you don't use that version!

1. Locate the mh4g weapon skin you want and locate the mhxx weapon you would like to replace.

2. Find the .arc file of the mh4g in romfs/data. Check and make sure that the file you want to replace has the same amount of common .tex files used in it. I'm not sure this will work if there's a mismatched common .tex files, so you may want to pick a different weapon skin.

View attachment 250523
mh4g weapon (I'm using the gogmazios IG for this example)

View attachment 250518
mhxx weapon (I'm transplanting it onto the ruiner glaive). Note that both have 2 common env .tex's in them.

open up the mhxx target file .arc file in a hex editor and change the common variables to that of the mh4g weapon.
View attachment 250534

3. Editing the mh4g .tex file
Byte 5 A5 -> A6

4. Editing the mh4g .mod file
Bytes 7C-80 00 00 00 5C 74 -> 80 00 00 00 00

after FF FF... string AND immediate numbers after ie FF 03 00 00 00 01 02
make sure next byte starts with 80 7F 01. Substitute the extra stuff with 0's.

View attachment 250535
(this is an example of what you need to delete)

Please note that there are sections where they declare values with the mh4g weapon number. You don't have to replace those, and if you do it will cause the "black texture glitch."

And finally in this variable declaration "×í" section (I'm not sure). Substitute the 2 blocks before with 0's. It sounds kind of random, but if you have studied a bunch of mhxx .mod files it would make sense.
View attachment 250536
This is an example of what needs to be done.

5. The .mrl section.....
This is probably the most tricky section and the most prone to the invisible weapon glitch. If your .mrl section is wrong it either makes the weapon have the mh4g model with a pitch black texture, and will look like this. Any multitude of things could have went wrong, so you might see this texture a lot....

View attachment 250537
Black texture glitch

Open the .mrl file of the mh4g weapon.

Bytes 10-14
61 AA C1 CE -> BD 0C CA EA

CD spam:
First, make sure that the path is directed toward the right .tex file. Afterward you want to spam "CD" bytes until you get to the "EB 5D 1F 24," "00 00 00 00," or "E4 EB B0 5F" blocks that's when the spam stops. There's usually about 8-10 blocks of "CD CD CD CD" spam. If this doesn't make sense just open any mhxx .mrl file. You'll see what I mean.

View attachment 250538

There should be 2 "strings" that begin with "E4 EB B0 5F" after the final CD spam:
View attachment 250540

Block replacement after final CD spam. I'm pretty sure that these are always the same length, and are always changed to the same values regardless of mh4g's initial value. Likewise, if something is safe, then it's always unchanged.

*safe means no change.
E4 EB B0 5F *safe
B6 42 BE 60 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D2 90 13 B8 -> D1 90 13 B8
DE F0 8C 10 -> DD F0 8C 10
08 00 3E 80 -> 08 C0 4D 80
00 00 80 84 *safe

E4 EB B0 5F chain #2
E4 EB B0 5F *safe
A3 34 3D 78 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D1 90 13 B8 -> D2 90 13 B8
DE F0 8C 10 -> DE F0 8C 10
08 60 E1 82 -> 08 C0 BB 82 (08 60 E1 82 + 00 5F DA 00) [use windows calculator in the programmer mode for this. This is the only part that requires some math] You always have to add for this block.

*safe means no change from mh4g -> mhxx.

Áͽ section(s).
This part is also a bit tricky, but luckily every block has the same exact format. Meaning that whatever is changed is always changed, and whatever is unchanged is always unchanged. There's only 2 Áͽ section in the mh4g file I selected, but there may be more than 2 depending on the weapon.

View attachment 250541
Here's the change log:

01 00 60 12 -> C1 CD BD 12 always
60 00 00 00 *safe
26 B1 A5 16 -> 2B B1 A5 16 always
E1 BE 9D 10 -> C1 CD 9D 10 always
10 01 00 00 *safe
09 11 80 6C *safe
83 00 0D 1A -> C3 CD AD 1A always
01 00 00 00 *safe
A0 F1 06 CD -> AA F1 06 CD always
12 FF BF 10 -> C2 CD BD 10 always
0B 31 6C 7F *safe
0B 31 6C 7F *safe
03 00 10 1A -> C3 CD BD 1A always
02 00 00 00 *safe and then the next one is 05 00 00 00.... etc (regardless it's always safe to not touch!).
A1 61 8E E8 -> AB 61 8E E8 always
03 00 70 1A -> C3 CD 1D 1B always
00 00 00 00 *safe
A7 21 51 C5 -> B1 21 51 C5 always
D3 01 AD 1A -> C3 CD 4D 1B always
03 00 00 00 *safe
AA 81 99 0B -> B4 81 99 0B always
E3 BE ED 1A -> C3 CD 8D 1B always
04 00 00 00 *safe
AE 11 EC 5D -> B8 11 EC 5D always

Here's the other one I had to change:
View attachment 250542

Finally at the end of the file you have to change one last thing:

View attachment 250543
26 B1 A5 16 -> 2B B1 A5 16 always
26 B1 A5 16 -> 2B B1 A5 16 always
21 04 00 00 *safe
01 0C 80 49 -> 01 0C C0 4A always

6. after you've completed your .mrl file edits, all you have to do is replace all of the files of the mhxx weapon in Karameru (don't forget the common env files!), and save to your sd card.

The final product should look like this:

View attachment 250515

Let me know if you are able to get it to work. It's quite the chore just to do one weapon....

can you explain this better. do you mean safe as in no need to change or just safe because have the same bytes?
 

klark231

Well-Known Member
Member
Joined
Jun 25, 2018
Messages
114
Trophies
0
Age
27
XP
605
Country
Philippines
So, I figured out how to add mh4u files to mhxx, but the process is a bit more involved. It's not impossible though, and hopefully I can explain in layman terms. It might help if you manage to replace an mhxx weapon with an mhxx weapon first instead of jumping straight into this.

I'm going to assume you have installed everything you need from my previous post, and you have experience of transplanting an mhxx weapon onto an mhxx weapon. As I had to fully understand that process in order to do this process....

0. you need to dump the romfs and arcfs files of mh4g (yes, the japanese version of mh4u I'll refer to it by that name so you don't forget this step!). You get a crash when changing clothes if you do this with mh4u files. There might be crashes elsewhere too, and it's unclear if this guide will work if you don't use that version!

1. Locate the mh4g weapon skin you want and locate the mhxx weapon you would like to replace.

2. Find the .arc file of the mh4g in romfs/data. Check and make sure that the file you want to replace has the same amount of common .tex files used in it. I'm not sure this will work if there's a mismatched common .tex files, so you may want to pick a different weapon skin.

View attachment 250523
mh4g weapon (I'm using the gogmazios IG for this example)

View attachment 250518
mhxx weapon (I'm transplanting it onto the ruiner glaive). Note that both have 2 common env .tex's in them.

open up the mhxx target file .arc file in a hex editor and change the common variables to that of the mh4g weapon.
View attachment 250534

3. Editing the mh4g .tex file
Byte 5 A5 -> A6

4. Editing the mh4g .mod file
Bytes 7C-80 00 00 00 5C 74 -> 80 00 00 00 00

after FF FF... string AND immediate numbers after ie FF 03 00 00 00 01 02
make sure next byte starts with 80 7F 01. Substitute the extra stuff with 0's.

View attachment 250535
(this is an example of what you need to delete)

Please note that there are sections where they declare values with the mh4g weapon number. You don't have to replace those, and if you do it will cause the "black texture glitch."

And finally in this variable declaration "×í" section (I'm not sure). Substitute the 2 blocks before with 0's. It sounds kind of random, but if you have studied a bunch of mhxx .mod files it would make sense.
View attachment 250536
This is an example of what needs to be done.

5. The .mrl section.....
This is probably the most tricky section and the most prone to the invisible weapon glitch. If your .mrl section is wrong it either makes the weapon have the mh4g model with a pitch black texture, and will look like this. Any multitude of things could have went wrong, so you might see this texture a lot....

View attachment 250537
Black texture glitch

Open the .mrl file of the mh4g weapon.

Bytes 10-14
61 AA C1 CE -> BD 0C CA EA

CD spam:
First, make sure that the path is directed toward the right .tex file. Afterward you want to spam "CD" bytes until you get to the "EB 5D 1F 24," "00 00 00 00," or "E4 EB B0 5F" blocks that's when the spam stops. There's usually about 8-10 blocks of "CD CD CD CD" spam. If this doesn't make sense just open any mhxx .mrl file. You'll see what I mean.

View attachment 250538

There should be 2 "strings" that begin with "E4 EB B0 5F" after the final CD spam:
View attachment 250540

Block replacement after final CD spam. I'm pretty sure that these are always the same length, and are always changed to the same values regardless of mh4g's initial value. Likewise, if something is safe, then it's always unchanged.

*safe means no change.
E4 EB B0 5F *safe
B6 42 BE 60 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D2 90 13 B8 -> D1 90 13 B8
DE F0 8C 10 -> DD F0 8C 10
08 00 3E 80 -> 08 C0 4D 80
00 00 80 84 *safe

E4 EB B0 5F chain #2
E4 EB B0 5F *safe
A3 34 3D 78 *safe
50 01 00 00 *safe
9E D0 B2 62 *safe
D1 90 13 B8 -> D2 90 13 B8
DE F0 8C 10 -> DE F0 8C 10
08 60 E1 82 -> 08 C0 BB 82 (08 60 E1 82 + 00 5F DA 00) [use windows calculator in the programmer mode for this. This is the only part that requires some math] You always have to add for this block.

*safe means no change from mh4g -> mhxx.

Áͽ section(s).
This part is also a bit tricky, but luckily every block has the same exact format. Meaning that whatever is changed is always changed, and whatever is unchanged is always unchanged. There's only 2 Áͽ section in the mh4g file I selected, but there may be more than 2 depending on the weapon.

View attachment 250541
Here's the change log:

01 00 60 12 -> C1 CD BD 12 always
60 00 00 00 *safe
26 B1 A5 16 -> 2B B1 A5 16 always
E1 BE 9D 10 -> C1 CD 9D 10 always
10 01 00 00 *safe
09 11 80 6C *safe
83 00 0D 1A -> C3 CD AD 1A always
01 00 00 00 *safe
A0 F1 06 CD -> AA F1 06 CD always
12 FF BF 10 -> C2 CD BD 10 always
0B 31 6C 7F *safe
0B 31 6C 7F *safe
03 00 10 1A -> C3 CD BD 1A always
02 00 00 00 *safe and then the next one is 05 00 00 00.... etc (regardless it's always safe to not touch!).
A1 61 8E E8 -> AB 61 8E E8 always
03 00 70 1A -> C3 CD 1D 1B always
00 00 00 00 *safe
A7 21 51 C5 -> B1 21 51 C5 always
D3 01 AD 1A -> C3 CD 4D 1B always
03 00 00 00 *safe
AA 81 99 0B -> B4 81 99 0B always
E3 BE ED 1A -> C3 CD 8D 1B always
04 00 00 00 *safe
AE 11 EC 5D -> B8 11 EC 5D always

Here's the other one I had to change:
View attachment 250542

Finally at the end of the file you have to change one last thing:

View attachment 250543
26 B1 A5 16 -> 2B B1 A5 16 always
26 B1 A5 16 -> 2B B1 A5 16 always
21 04 00 00 *safe
01 0C 80 49 -> 01 0C C0 4A always

6. after you've completed your .mrl file edits, all you have to do is replace all of the files of the mhxx weapon in Karameru (don't forget the common env files!), and save to your sd card.

The final product should look like this:

View attachment 250515

Let me know if you are able to get it to work. It's quite the chore just to do one weapon....
can you do tenssaiga sword of inuyasha. its pl_swo076. ive followed your guide but i cant get rid of the black texture. it has 2 .mrl and 2 .mod. im editing Wrathful Beheader 019.arc. it has an almost identical .mrl i dont know whats wrong
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Veho @ Veho:
    Illinois is working to ban toxic food additives that have been banned for decades in other countries; additives that can be replaced and all those countries still have Skittles and Mountain Dew. Title of the piece: GUBMINT WANTS TO TAKE AWAY YOUR CANDY
  • Veho @ Veho:
    Gee, I wonder if the author is biased?
  • SylverReZ @ SylverReZ:
    @Veho, Sounds and smells like bullshit. They don't give you cancer, and California should know that. I don't get why they stick labels that say "may or may not cause reproductive harm or cancer".
  • Veho @ Veho:
    Arsenic doesn't give you cancer either.
    +2
  • Veho @ Veho:
    California has already banned those additives BTW.
    +2
  • Veho @ Veho:
    Psi has been banned in the state of California.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I am the cancer!!! lol
  • Psionic Roshambo @ Psionic Roshambo:
    Yayyy got arcade games on the Pi working lol
  • Veho @ Veho:
    Cool.
  • Psionic Roshambo @ Psionic Roshambo:
    Now to spend 6 months deleting all the garbage lol
  • Psionic Roshambo @ Psionic Roshambo:
    Mame should be two sets one for preservation of everything and one set for people who just want to play and enjoy the old old ganes
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Shouldn't preservation be legal tho?
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, I always see this dude's shorts, he sounds pretty annoying.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Preservation yeah it absolutely should be legal
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, Believe Japan was going to make it legal at some point, according to a Kotaku story.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    I swear like 99% of arcade games wouldn't even exist these days outside of MAME the arcade machines are old and busted very few ever saw any sort of home conversion
  • Psionic Roshambo @ Psionic Roshambo:
    We get 37 versions of Super Mario Bros but 0 of Beast Busters
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, There's a lot of obscure Japanese arcade titles that are either lost to time or dumped.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    It's so unfair, maybe AI can save us lol
  • Psionic Roshambo @ Psionic Roshambo:
    I mean if a company could use AI to do the work of a home conversion for essentially free why not? The rights for some games are completely lost though
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, AI is taking our jobs!
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Just tried the Master System version.... Ugghh
    Psionic Roshambo @ Psionic Roshambo: Just tried the Master System version.... Ugghh