Monster Hunter World (PC) - chunk.bin files

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

Hello there people!

I want to translate Monster Hunter World, but first I need to extract the files that are stored in chunk0.bin and chunk1.bin files. The first one is a whopping 16.6 gb file.

I cut the first 5 mb out of it and you can download it from below, if this can help determine how to extract it.

Game uses a modified MT Framework / Umbra engine if this counts.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by aluigi »

There is just a "CMP" magic followed by many 64bit fields or similar plus other data. No information about the archived files.
Maybe upload the tail too.
DAOWAce
Posts: 1
Joined: Fri Aug 10, 2018 8:23 am

Re: Monster Hunter World (PC) - chunk.bin files

Post by DAOWAce »

This was mentioned here a few months ago: viewtopic.php?f=9&t=7974

I used the filecutter.bms provided to split the main archive.

This thread may provide more helpful info into extracting it: viewtopic.php?f=9&t=2863
Vuze
Posts: 16
Joined: Sun Dec 28, 2014 3:02 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Vuze »

Here should be all the string container files (from all languages), just drop the folder in the archive in the root of the game installation. It will then read those instead of from CMP files. Initial loading time might slow down, I haven't tested it. You can of course remove gmd from languages you don't edit and the game will fall back to the CMP file for these, it was just easier for me to grab all of them instead of just _eng or whatever. Obviously use it at your own risk, idk if they are validating the files loaded in memory and banning or similar. Hence why I'm not publicly putting out my tool just yet.

https://mega.nz/#!dQAQVKYB!IylV3yM9MwSD ... CWg33CgJF8
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

Wow, this looks just like the Souls games, where you edit the exe and it loads the files outside of the container.

Will test it out to see how it works. Also if they ban for modifying just strings from the game I'll hit them hard lol :D
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

Okay, it works wonderfully, thanks for this!

Question: There are some strings that are textures (like the QUEST COMPLETED stuff), can we also edit that?
Vuze
Posts: 16
Joined: Sun Dec 28, 2014 3:02 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Vuze »

Yeah, but textures are obviously a little more complicated than these gmd files and my tool only covers 2 out of 11 compression types used so far.
Shadsterwolf
Posts: 1
Joined: Fri Aug 10, 2018 2:01 am

Re: Monster Hunter World (PC) - chunk.bin files

Post by Shadsterwolf »

Now you got me curious which types of compression is used.
Fatalitiko
Posts: 1
Joined: Sun Aug 12, 2018 12:31 am

Re: Monster Hunter World (PC) - chunk.bin files

Post by Fatalitiko »

I am trying to get the images that use the game, in the interface and different symbols, emblems, banners, could someone help me?
leave a picture marking what I say

Image
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

I translated some string in the .gmd files simply by editing them, and I just noticed that in the cutscenes it doesn't always display what I wrote. I mean if the file is longer than the one I wrote, it simply cuts off the text somewhere. Any idea for a fix?
Vuze
Posts: 16
Joined: Sun Dec 28, 2014 3:02 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Vuze »

The_Reaper_CooL wrote:I translated some string in the .gmd files simply by editing them, and I just noticed that in the cutscenes it doesn't always display what I wrote. I mean if the file is longer than the one I wrote, it simply cuts off the text somewhere. Any idea for a fix?

You'll need a proper tool to edit the gmd meta data to adapt the length of the new strings if they exceed the original text. Meta data seems XOR'd much like in MHXX but the expressions are different for World it seems.
Or do you mean you use such a tool and it cuts off in cutscenes despite the adapted length and offsets? If so, no idea.
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

Vuze wrote:
The_Reaper_CooL wrote:I translated some string in the .gmd files simply by editing them, and I just noticed that in the cutscenes it doesn't always display what I wrote. I mean if the file is longer than the one I wrote, it simply cuts off the text somewhere. Any idea for a fix?

You'll need a proper tool to edit the gmd meta data to adapt the length of the new strings if they exceed the original text. Meta data seems XOR'd much like in MHXX but the expressions are different for World it seems.
Or do you mean you use such a tool and it cuts off in cutscenes despite the adapted length and offsets? If so, no idea.


Nope, I don't have any tool, I just edit it with Notepad++.

And just by reading your comment I started to tinker with Hex Workshop, and it seems that on the offset 0x00000020 it stores the string's length in int32. I modified it, and now it works. I only tested this on one cutscene, don't know if it would work in other files (but since all of them are .gmd I think they would)

Edit:
Okay, some things I've discovered via Hex Editing:

In the .gmd files, you can find this data:

Offset: 0x00000013 -> Up to this point is just a header for the .gmd file
Offset: 0x00000014 -> The number of string IDs in the file
Offset: 0x00000018 -> The number of strings in the file (these two should match of course)
Offset: 0x0000001C -> The length of the string IDs names
Offset: 0x00000020 -> The length of the strings
Offset: 0x00000024 -> The length of the current file's name inside the .gmd file
Offset: 0x00000028 -> This is where the current file's name is stored

Using this if someone has the skills to develop a tool, then it would be nice. I myself can only program in Excel VBA, but I'll try to do something with it.
Moon
Posts: 2
Joined: Mon Aug 13, 2018 2:28 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Moon »

Hi There

I try too open the Chunk0.bin because i want to eddit the Textures from the game.
but i dont know how this work :(

can some one help me plz

what 4 a programm ist the best for it or witch script i have to use to extrackt the files from the game?

and if its posibil too change something in the extrakt files and zip it back to the chunk0.bin file ??


Thx 4 ur help :)
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

So I've used my vast Excel VBA knowledge and created an Excel Macro Sheet that can read the .gmd files, open up the string from them, then it can save them so they work as intended. I'm so proud of myself now :D

Note that it's only for Hungarian translations, and since I'm the one that's using it, the """tool""" isn't available publicly. If you need it for your private usage then PM me and I'll see what I can do.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Ekey »

is there any tools to unpack the chunk's archives? or any information about on the structures / compression (Oddle?) / encryption?
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by chrrox »

Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Delutto »

Ekey wrote:is there any tools to unpack the chunk's archives? or any information about on the structures / compression (Oddle?) / encryption?
There's a work-in-progress script for chunk's here: https://zenhax.com/viewtopic.php?f=9&t=7974#p35575
About Oodle, see the quickbms source, there's a implementation for compress and decompress using the Oodle dll.
And for encryption, I don't believe that use a simple xor like savegames, otherwise aluigi would have found out. And the game probably uses some file integrity check.
Vuze wrote:...adapt the length of the new strings if they exceed the original text.
Hum... are you talking about string length or text block length? I only see the "Key Count", "Text Count", "Key Block Size" and "Text Block Size" in these GMD files... and no clue about table size or offset field to key block or text block... can you share more info about the structure?
Last edited by Delutto on Tue Aug 14, 2018 7:57 pm, edited 1 time in total.
Vuze
Posts: 16
Joined: Sun Dec 28, 2014 3:02 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Vuze »

chrrox wrote:only thing i see is saved game
https://github.com/Nexusphobiker/MHWSaveDecrypter

Nice find, I was just about to look into this. Game uses similar encryption on a certain file type too, so that's doubly useful.

Here's my chunk tool. I cleaned it up for the release a bit, hope I didn't break anything.
https://github.com/mhvuze/WorldChunkTool

As I said above, just put modified files with correct folder structure in a folder "nativePC" in the directory of Monster Hunter World exe. Game will prioritize files therein over chunkN.bin. Hope they don't remove that but given the state of the PC version, I hope they work on other stuff like fixing texture loading, mouse acceleration and online mode :mrgreen:

Delutto wrote:
Vuze wrote:...adapt the length of the new strings if they exceed the original text.
Hum... are you talking about string length or text block length? I only see the "Key Count", "Text Count", "Key Block Size" and "Text Block Size" in these GMD files... and no clue about table size or offset field to key block or text block... can you share more info about the structure?

Maybe I'm just mixing things up or it is different from previous MT Framework games, I was under the impression you had to update offsets, length etc. Haven't actually looked at modifying the MHWorld gmds, just dumping the text.
The_Reaper_CooL
Posts: 69
Joined: Sat Dec 05, 2015 2:31 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by The_Reaper_CooL »

Delutto wrote:
Ekey wrote:is there any tools to unpack the chunk's archives? or any information about on the structures / compression (Oddle?) / encryption?
There's a work-in-progress script for chunk's here: https://zenhax.com/viewtopic.php?f=9&t=7974#p35575
About Oodle, see the quickbms source, there's a implementation for compress and decompress using the Oodle dll.
And for encryption, I don't believe that use a simple xor like savegames, otherwise aluigi would have found out. And the game probably uses some file integrity check.
Vuze wrote:...adapt the length of the new strings if they exceed the original text.
Hum... are you talking about string length or text block length? I only see the "Key Count", "Text Count", "Key Block Size" and "Text Block Size" in these GMD files... and no clue about table size or offset field to key block or text block... can you share more info about the structure?


I wrote about the .gmd file's structures a bit above, here they are again:

In the .gmd files, you can find this data:

Offset: 0x00000013 -> Up to this point is just a header for the .gmd file
Offset: 0x00000014 -> The number of string IDs in the file
Offset: 0x00000018 -> The number of strings in the file (these two should match of course)
Offset: 0x0000001C -> The length of the string IDs names
Offset: 0x00000020 -> The length of the strings
Offset: 0x00000024 -> The length of the current file's name inside the .gmd file
Offset: 0x00000028 -> This is where the current file's name is stored


EDIT:
I also made an Excel Macro Sheet that can read and modify these, I just don't want to make it public, fearing someone might translate the game into Hungarian and that person would not be me.
Delutto
Posts: 561
Joined: Tue Oct 13, 2015 1:26 pm

Re: Monster Hunter World (PC) - chunk.bin files

Post by Delutto »

The_Reaper_CooL wrote:
In the .gmd files, you can find this data:

Offset: 0x00000013 -> Up to this point is just a header for the .gmd file
Offset: 0x00000014 -> The number of string IDs in the file
Offset: 0x00000018 -> The number of strings in the file (these two should match of course)
Offset: 0x0000001C -> The length of the string IDs names
Offset: 0x00000020 -> The length of the strings
Offset: 0x00000024 -> The length of the current file's name inside the .gmd file
Offset: 0x00000028 -> This is where the current file's name is stored

EDIT:
I also made an Excel Macro Sheet that can read and modify these, I just don't want to make it public, fearing someone might translate the game into Hungarian and that person would not be me.
Congratulations!
But you need check the structure in many files, in different folders, with different types of text(guessing by filename), not just one, because the structure can change, that's the case in this GMD files, you probably analysed just the smallest one... now look the bigest ones like the "item_eng.gmd", after FileName, you will see a table, that table has 32 bytes fields size and KeyCount fields count. After this table there's a unknown data block, always with size 0x800.
By the way, KeyCount and TextCount are not equal in some files.
So, in your code you need put a condition, like if the (Position after FileName(+1) + KeyBlockSize + TextBlockSize = GMD FileSize), if true, there's no table on file, if not, you need sum(Position after FileName(+1) + (KeyCount * 32) + 2048 + KeyBlockSize), now you have the offset of the texts. Sorry, I can just explain the logic, I don't known how to do this in VBA.

Monster Hunter World GMD Tool
By Delutto
See Readme.txt for instructions.
Monster_Hunter_World_GMD_Tool_By_Delutto.7z

Notes: Based on file samples and not tested ingame. There's a lot of unknown data, so there's a good chance that mod files will not works...