Skip to content

mhfdat.bin

Variable Username edited this page Nov 7, 2023 · 4 revisions

mhfdat.bin is a large file. Despite containing no textures, models, or sound, it still amounts to 27.4MB when decompressed. With all this data to parse, it can help to know what everything is.

Primary Structure

Most of mhfdat.bin is read from pointers. As such, only some top-level pointers must be in specific positions in the file. The rest of the information in the file is read relative to these pointers, so there's no definitive order different elements must be in.

Header

The header of mhfdat.bin consists first of a file signature, followed by the top-level pointer array.

When encrypted, the first four bytes of the file must be 65 63 64 1A or 0x1A646365, or else Monster Hunter Frontier will error out. Once decrypted, the file will be compressed, and will have a signature in the first four bytes of 4A 4B 52 1A, or 0x1A524B4A. ReFrontier's default settings will both decrypt and decompress any files you give it, so you don't need to worry about most of these details, just that these magic bytes mean certain things to Frontier.

Finally, when decrypted and decompressed, mhfdat.bin has three file signatures in the first 16 bytes. The first four bytes must be 6D 68 66 1A, or 0x1A66686D. The next four bytes must be 59 00 00 00, or 0x00000059, there is a four byte gap, and then the last four bytes must be C8 0B 00 00, or 0x00000BC8. If any of these bytes are different, Frontier will crash. The four byte gap between the second and third signature is modified in memory after the file is read.

Top-level Pointer array

After the sixteen byte signature, mhfdat.bin has a pointer array, which is used by Frontier to read the rest of the file. Many of these pointers aren't well understood, but what is known will be listed.

Details

Top-level Pointer array details

There are a lot of pointers and I'm writing this table by hand so this is going to take a while, sit tight.

  • Position: The location of the pointer in the file
  • Address of discovery: Where this pointer was discovered when decompiling Frontier. This location is the offset of the instruction from the file's start. Ghidra names it the "Byte Source Offset"
  • Aliases: More friendly names these pointers are given in the header ptr_table.
  • Comments: Self-explanatory
Position Address of discovery Aliases Comments
0x010 [mhfo-hd.dll + 0xaf46a3] important_nums Seems to point to an array of important constants, such as the number of items in the game
0x014 - 0x030 N/A Empty, perhaps remnants of an older structure
0x034 [mhfo-hd.dll + 0xaf47cc] armorForging Points to an array of armor forging data structs
0x038 [mhfo-hd.dll + 0xaf47cf] otherWeaponForging Array of miscellaneous weapon forging data
0x03c [mhfo-hd.dll + 0xaf47d2] weaponUpgradePath Data of which weapons upgrade to which other weapons
0x040 [mhfo-hd.dll + 0xaf47d5] Currently unknown
0x044 [mhfo-hd.dll + 0xaf47d8] Currently unknown
0x048 [mhfo-hd.dll + 0xaf47e1] Currently unknown
0x04c [mhfo-hd.dll + 0xaf47c9] armorUpgradeMats Array of materials required to upgrade armor
0x050 [mhfo-hd.dll + 0xaf480f] headArmor Head Armor Data
0x054 [mhfo-hd.dll + 0xaf4852] bodyArmor Body Armor Data
0x058 [mhfo-hd.dll + 0xaf4893] armArmor Arm Armor Data
0x05c [mhfo-hd.dll + 0xaf48d4] waistArmor Waist Armor Data
0x060 [mhfo-hd.dll + 0xaf4922] legArmor Leg Armor Data
0x064 [mhfo-hd.dll + 0xaf482e] headArmorNames Array of Head Armor Names
0x068 [mhfo-hd.dll + 0xaf4871] bodyArmorNames Array of Body Armor Names
0x06c [mhfo-hd.dll + 0xaf48b2] armArmorNames Array of Arm Armor Names
0x070 [mhfo-hd.dll + 0xaf48fd] waistArmorNames Array of Waist Armor Names
0x074 [mhfo-hd.dll + 0xaf4941] legArmorNames Array of Leg Armor Names
0x078 [mhfo-hd.dll + 0xaf4963] equipDesc Array of Equipment Description Strings
0x07c [mhfo-hd.dll + 0xaf49a6] meleeWeapons Melee Weapon Data
0x080 [mhfo-hd.dll + 0xaf4a34] rangedWeapons Ranged Weapon Data
0x084 [mhfo-hd.dll + 0xaf4a5d] rangedWeaponNames Array Ranged Weapon Names
0x088 [mhfo-hd.dll + 0xaf49cd] meleeWeaponNames Array of Melee Weapon Names
0x08c [mhfo-hd.dll + 0xaf49d3] meleeWeaponDesc Array of Melee Weapon Descriptions
0x090 [mhfo-hd.dll + 0xaf4a63] rangedWeaponDesc Array of Ranged Weapon Descriptions
0x094 [mhfo-hd.dll + 0xaf4ac4] armorStatArray Array of Pointers to Armor Stat Data, seems redundant?
0x098 [mhfo-hd.dll + 0xaf4b1c] armorWeaponStatArray Array of Pointers to Armor and Weapon Stat Data, probably redundant
0x09c [mhfo-hd.dll + 0xaf4b80] armorNameArray Array of Pointers to Armor Names, probably redundant
0x0a0 [mhfo-hd.dll + 0xaf5038]
0x0a4 [mhfo-hd.dll + 0xaf503e]
0x0a8 [mhfo-hd.dll + 0xaf5044]
0x0ac [mhfo-hd.dll + 0xaf504a]
0x0b0 [mhfo-hd.dll + 0xaf5073]
0x0b4 [mhfo-hd.dll + 0xaf5079]
0x0b8 [mhfo-hd.dll + 0xaf507f]
0x0bc [mhfo-hd.dll + 0xaf5085]
0x0c0 [mhfo-hd.dll + 0xaf508b]
0x0c4 [mhfo-hd.dll + 0xaf4bc6]
0x0c8 [mhfo-hd.dll + 0xaf4bf5]
0x0cc [mhfo-hd.dll + 0xaf4bfb]
0x0d0 [mhfo-hd.dll + 0xaf4cd1]
0x0d4 [mhfo-hd.dll + 0xaf4cd7]
0x0d8 [mhfo-hd.dll + 0xaf4cc5]
0x0dc [mhfo-hd.dll + 0xaf4d14]
0x0e0 [mhfo-hd.dll + 0xaf4d08]
0x0e4 [mhfo-hd.dll + 0xaf47b5]
0x0e8 [mhfo-hd.dll + 0xaf47af]
0x0ec [mhfo-hd.dll + 0xaf4d2d]
0x0f0 [mhfo-hd.dll + 0xaf4d58] hunterPearlSkills Referenced in ReFrontier
0x0f4 [mhfo-hd.dll + 0xaf4d7b]
0x0f8 [mhfo-hd.dll + 0xaf4daf]
0x0fc [mhfo-hd.dll + 0xaf4db5] itemData Item Data
0x100 [mhfo-hd.dll + 0xaf4da3] itemNames Item Names
0x104 [mhfo-hd.dll + 0xaf4dec]
0x108 [mhfo-hd.dll + 0xaf4df2]
0x10c [mhfo-hd.dll + 0xaf4df8]
0x110 [mhfo-hd.dll + 0xaf4de0]
0x114 [mhfo-hd.dll + 0xaf4e1b]
0x118 [mhfo-hd.dll + 0xaf4e0f]
0x11c [mhfo-hd.dll + 0xaf4e3a]
0x120 [mhfo-hd.dll + 0xaf4e5a] carveItemDrops Carve Drop Data
0x124 [mhfo-hd.dll + 0xaf4e82] partBreakItemDrops Part Break Data
0x128 [mhfo-hd.dll + 0xaf4ec1]
0x12c [mhfo-hd.dll + 0xaf4eb8] itemDesc Item Descriptions
0x130 [mhfo-hd.dll + 0xaf4f23]
0x134 [mhfo-hd.dll + 0xaf4fc1] monsterDesc
0x138 [mhfo-hd.dll + 0xaf4ff0]
0x13c [mhfo-hd.dll + 0xaf5145]
0x140 [mhfo-hd.dll + 0xaf517d]
0x144 [mhfo-hd.dll + 0xaf5177] arenaItems
0x148 [mhfo-hd.dll + 0xaf51b6] arenaEquipment
0x14c [mhfo-hd.dll + 0xaf51ec] arenaStageIDC1
0x150 [mhfo-hd.dll + 0xaf51e0]
0x154 [mhfo-hd.dll + 0xaf521a] arenaStageIDC0
0x15c [mhfo-hd.dll + 0xaf5261] arenaAmmo
0x160 [mhfo-hd.dll + 0xaf5298] machaPotRewards
0x164 [mhfo-hd.dll + 0xaf52c0]
0x168 [mhfo-hd.dll + 0xaf52ba]
0x16c [mhfo-hd.dll + 0xaf52f3]
0x170 - 0x17c N/A
0x180 [mhfo-hd.dll + 0xaf5397]
0x184 [mhfo-hd.dll + 0xaf53c0]
0x188 [mhfo-hd.dll + 0xaf53f0]
0x18c [mhfo-hd.dll + 0xaf5421]
0x190 [mhfo-hd.dll + 0xaf5427]
0x194 [mhfo-hd.dll + 0xaf542d]
0x198 [mhfo-hd.dll + 0xaf5455]
0x19c [mhfo-hd.dll + 0xaf5491]
0x1a0 [mhfo-hd.dll + 0xaf54d3]
0x1a4 [mhfo-hd.dll + 0xaf5542]
0x1a8 [mhfo-hd.dll + 0xaf5570]
0x1ac [mhfo-hd.dll + 0xaf55a0]
0x1b0 [mhfo-hd.dll + 0xaf55d0]
0x1b4 [mhfo-hd.dll + 0xaf5611]
0x1b8 [mhfo-hd.dll + 0xaf5640]
0x1bc [mhfo-hd.dll + 0xaf5646]
0x1c0 [mhfo-hd.dll + 0xaf5661]
0x1c4 [mhfo-hd.dll + 0xaf567c]
0x1c8 [mhfo-hd.dll + 0xaf57f2]
0x1cc [mhfo-hd.dll + 0xaf583d]
0x1d0 [mhfo-hd.dll + 0xaf5843]
0x1d4 [mhfo-hd.dll + 0xaf56ea]
0x1d8 [mhfo-hd.dll + 0xaf56cc]
0x1dc [mhfo-hd.dll + 0xaf56d2]
0x1e0 [mhfo-hd.dll + 0xaf56d8]
0x1e4 [mhfo-hd.dll + 0xaf56de]
0x1e8 [mhfo-hd.dll + 0xaf56e4]
0x1ec [mhfo-hd.dll + 0xaf5682]
0x1f0 [mhfo-hd.dll + 0xaf5693]
0x1f4 [mhfo-hd.dll + 0xaf56a4]
0x1f8 [mhfo-hd.dll + 0xaf56b5]
0x1fc [mhfo-hd.dll + 0xaf56c6]
...
0x32c [mhfo-hd.dll + 0xaf5bdc] carveHCItemDrops Carve HC Drop Data
...
0x5f0 [mhfo-hd.dll + 0xaf6bfc] weaponGRForging G-Rank Weapon Forging Structs
0x5f4 [mhfo-hd.dll + 0xaf6c02] armorGRForging G-Rank Armor Forging Structs
0x5f8 [mhfo-hd.dll + 0xaf6c08]
0x5fc [mhfo-hd.dll + 0xaf6c0e] weaponG50Forging
...
0x738 [mhfo-hd.dll + 0xaf774d] carveGRHCItemDrops Carve G-Rank HC Drop Data
...
0x7ac [mhfo-hd.dll + 0xaf7875] weaponSpecialForging Special Weapon Forging Structs
...
0x940 [mhfo-hd.dll + 0xaf831a] weaponTowerForging Tower Weapon Forging Structs
...
0x998 [mhfo-hd.dll + 0xaf83b1] armorTowerForging Tower Armor Forging Structs
...
0xa18 [mhfo-hd.dll + 0xaf872c] evoUpgrades Evolution Upgrade Data
...
0xa40 [mhfo-hd.dll + 0xaf4ef0] itemSourceStrings Text describing where each item can be obtained
...
0xa98 [mhfo-hd.dll + 0xaf8cb2] questList
...
0xab8 [mhfo-hd.dll + 0xaf8d48] transmogForging
0xabc
0xac0 [mhfo-hd.dll + 0xaf8d54] weaponForging
0xac4 [mhfo-hd.dll + 0xaf8d5a] armorZenithForging
...
0xb2c [mhfo-hd.dll + 0xaf8f43] specialShops
...
Clone this wiki locally