Jump to content

Battlefront 2 - FBMOD files


Go to solution Solved by ikskoks,

Recommended Posts

  • michalss changed the title to Battlefront 2
  • ikskoks changed the title to Battlefront 2 - FBMOD files
  • Moderators
  • Solution
Posted

First of all, FrostyToolsuite is the software which can handle FBMOD files. It's open source and it's code can be found here https://github.com/CadeEvs/FrostyToolsuite

I've spent some time analyzing the code, but anyone can do it, especially you - since you're seem to be desperate you should at least try to do this. You can go even further and download the code and try to debug the program and see how it works during runtime.

File format is not so complicated, but it may be hard to parse without full knowledge of the FrostyToolsuite code.
It looks like this:

 

// FBMOD file format
// Based on format version 3

// header
8 bytes (uint64) - signature // "FROSTY\x00\x01" / 46 52 4F 53 54 59 00 01
4 bytes (uint32) - version // 3, 4 - ??
                           // 5 - Frosty Toolsuite v1.0.7
8 bytes (uint64) - info offset
4 bytes (uint32) - number of files
1 byte (uint8) - profile name length
x bytes (char) - profile name  // e.g. "FIFA19"
4 bytes (uint32) - unknown


// mod info
x bytes (char) - mod title
x bytes (char) - mod author
x bytes (char) - mod category
x bytes (char) - mod version
x bytes (char) - mod description


// resources
4 bytes (uint32) - number of resources
number_of_resources *
{
   1 byte (uint8) - resource type   // 0 - Embedded e.g. Icon
                                    // 1 - EBX
                                    // 2 - Resources
                                    // 3 - Chunk
                                    // 4 - Bundle
   x bytes - resource data
   e.g.

   // Base Resource
   // same as EBX, Embedded (e.g.Icon)
   4 bytes (uint32) - resource index
   x bytes (char) - resource name  // e.g. "Icon"
   20 bytes - SHA1
   8 bytes (uint64) - file uncompressed size
   1 byte (uint8) - flags
   4 bytes (uint32) - handler hash
   x bytes (char) - user data + null
   
   // FrostyPlugin/Mod/BaseModResource.cs lines 76-86 for more details
   if version <= 3:
   {
       4 bytes (uint32) - count1
       count1 *
       {
          4 bytes (uint32) - some value
       {

       4 bytes (uint32) - count2
       count2 *
       {
          4 bytes (uint32) - some value
       {
   }

   if version > 3:
   {
       4 bytes (uint32) - count3
       count3 *
       {
          4 bytes (uint32) - some value
       {
   }
   

}

// info table (resource data table)
number_of_files *
{
   8 bytes (uint64) - file relative offset
   8 bytes (uint64) - file compressed size
}

// data
number_of_files *
{
   number_of_chunks *
   {
      // FrostySDK/Utils.cs lines 935-940 for more details
      4 bytes (uint32) - buffer size (big endian)
      2 bytes (uint16) - compression code (big endian)
      2 bytes (uint16) - compressed chunk size (big endian)
      x bytes - compressed chunk data
   }
}

 

I tried to create a script with automatic decompression of the data, but it turned out to be too complicated task,
so I've just created a simple script for extraction instead https://github.com/bartlomiejduda/Tools/blob/master/NEW Tools/FrostyToolsuite/Frosty_Toolsuite_FBMOD_script.bms


I hope that all this info will help you in your reverse engineering research. 🙂 

  • 1 month later...
Posted
On 5/7/2024 at 5:01 PM, ikskoks said:

First of all, FrostyToolsuite is the software which can handle FBMOD files. It's open source and it's code can be found here https://github.com/CadeEvs/FrostyToolsuite

I've spent some time analyzing the code, but anyone can do it, especially you - since you're seem to be desperate you should at least try to do this. You can go even further and download the code and try to debug the program and see how it works during runtime.

File format is not so complicated, but it may be hard to parse without full knowledge of the FrostyToolsuite code.
It looks like this:

 

// FBMOD file format
// Based on format version 3

// header
8 bytes (uint64) - signature // "FROSTY\x00\x01" / 46 52 4F 53 54 59 00 01
4 bytes (uint32) - version // 3, 4 - ??
                           // 5 - Frosty Toolsuite v1.0.7
8 bytes (uint64) - info offset
4 bytes (uint32) - number of files
1 byte (uint8) - profile name length
x bytes (char) - profile name  // e.g. "FIFA19"
4 bytes (uint32) - unknown


// mod info
x bytes (char) - mod title
x bytes (char) - mod author
x bytes (char) - mod category
x bytes (char) - mod version
x bytes (char) - mod description


// resources
4 bytes (uint32) - number of resources
number_of_resources *
{
   1 byte (uint8) - resource type   // 0 - Embedded e.g. Icon
                                    // 1 - EBX
                                    // 2 - Resources
                                    // 3 - Chunk
                                    // 4 - Bundle
   x bytes - resource data
   e.g.

   // Base Resource
   // same as EBX, Embedded (e.g.Icon)
   4 bytes (uint32) - resource index
   x bytes (char) - resource name  // e.g. "Icon"
   20 bytes - SHA1
   8 bytes (uint64) - file uncompressed size
   1 byte (uint8) - flags
   4 bytes (uint32) - handler hash
   x bytes (char) - user data + null
   
   // FrostyPlugin/Mod/BaseModResource.cs lines 76-86 for more details
   if version <= 3:
   {
       4 bytes (uint32) - count1
       count1 *
       {
          4 bytes (uint32) - some value
       {

       4 bytes (uint32) - count2
       count2 *
       {
          4 bytes (uint32) - some value
       {
   }

   if version > 3:
   {
       4 bytes (uint32) - count3
       count3 *
       {
          4 bytes (uint32) - some value
       {
   }
   

}

// info table (resource data table)
number_of_files *
{
   8 bytes (uint64) - file relative offset
   8 bytes (uint64) - file compressed size
}

// data
number_of_files *
{
   number_of_chunks *
   {
      // FrostySDK/Utils.cs lines 935-940 for more details
      4 bytes (uint32) - buffer size (big endian)
      2 bytes (uint16) - compression code (big endian)
      2 bytes (uint16) - compressed chunk size (big endian)
      x bytes - compressed chunk data
   }
}

 

I tried to create a script with automatic decompression of the data, but it turned out to be too complicated task,
so I've just created a simple script for extraction instead https://github.com/bartlomiejduda/Tools/blob/master/NEW Tools/FrostyToolsuite/Frosty_Toolsuite_FBMOD_script.bms


I hope that all this info will help you in your reverse engineering research. 🙂 

using the script with quickBMS, spits out all .dat files. where would i go from there? 

  • 11 months later...
Posted
On 5/27/2025 at 12:40 AM, NightwolfPrime said:

I honestly don't know how to do any of this, < deleted by moderator - please read the site rules > I'm trying to get the fbmod into FrostyEditor

any solution? have been working on extracting data from the fbmod files and looking for signatures using hxd and python. so far basically no results

Posted
On 6/22/2024 at 11:33 PM, ikskoks said:

This script is for extracting only. Data is still compressed after extraction, so you would need to decompress it manually (or write another script to do it automatically).

You can see FrostySDK/Utils.cs on repository https://github.com/CadeEvs/FrostyToolsuite for more details.

I know I´m late, but could you explain to me how to decompress the actual .dat files? I found a way to decompress some of those .dat files but only for the most basic like PNGs. No textures or anything. Trying to get something more out of it but I don`t know much about all this.

  • Moderators
Posted

I don't remember exactly, but there's something like 2-byte compression code which tells you which compression type is used.
And it's always one of these: ZSTD, LZ4, OODLE or ZLIB.
So you have to decompress each chunk separately and then merge them to create output decompressed file.

  • Thanks 1
Posted
6 hours ago, ikskoks said:

I don't remember exactly, but there's something like 2-byte compression code which tells you which compression type is used.
And it's always one of these: ZSTD, LZ4, OODLE or ZLIB.
So you have to decompress each chunk separately and then merge them to create output decompressed file.

Oh yeah I got that far already, atleast for the compression methods. I`ve been working on the decompression for about 2 days now and decompressing each chunk seems complicated, as I am not really that experienced at all. Thanks for answering that quick though.

  • Like 1
Posted

Could you maybe provide a script for the decompression too? Ik its a lot I am asking for, but Ive been working on this for more than two days now and could only encode a single .png. You seem to have much more experience than me and the only way I could even get this far was using your original script to extract the .dat files from the .fbmod files. That script would be very much appreciated. Thank you for your help

 

  • Moderators
Posted

Sorry, but format seems to be too complicated and I'm not interested in dealing with it right now.
But maybe other ResHax users will be able to help, we'll see.

  • Like 1
Posted
5 hours ago, ikskoks said:

Sorry, but format seems to be too complicated and I'm not interested in dealing with it right now.
But maybe other ResHax users will be able to help, we'll see.

Thanks for the script anyway, appreciate the advise.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...