Skip to main content

Overview

The FileSystem class provides an abstraction layer for accessing Frostbite game file systems. It handles path resolution, catalog enumeration, superbundle management, and the InitFS memory file system.

Constructor

constructor
Creates a new FileSystem instance for a game installation
string
required
Path to the game installation directoryExample: @"C:\Program Files (x86)\Origin Games\Battlefield 5"

Initialization

void
Initializes the file system by loading layout.toc and initfs
byte[]
default:"null"
Encryption key for games that use encrypted InitFS
This method:
  • Processes layout.toc (base and patch)
  • Loads catalogs from install manifest
  • Loads InitFS memory file system
  • Merges patch and base data

Properties

string
Game installation directory path
string
Path to the cache file for this profile
uint
Base version number from layout.toc
uint
Head version number from layout.toc (current patch level)
int
Total number of superbundles
IEnumerable<string>
Enumerable collection of all superbundle names
int
Total number of catalogs
IEnumerable<string>
Enumerable collection of all catalog names

Path Resolution

string
Resolves a game-relative path to an absolute file system path
string
required
Game-relative path using forward slashes
Returns: Absolute file system path, or empty string if not foundSupported prefixes:
  • native_data/ - Base game data
  • native_patch/ - Patch data
  • No prefix - Searches both locations
string
Resolves a ManifestFileRef to an absolute path
ManifestFileRef
required
Manifest file reference

Catalog Management

string
Gets the catalog name that contains a specific superbundle
string
required
Superbundle name
string
Gets the catalog name from a ManifestFileRef
IEnumerable<CatalogInfo>
Enumerates detailed catalog information
CatalogInfo Properties:
  • Id (Guid) - Unique catalog identifier
  • Name (string) - Catalog path name
  • AlwaysInstalled (bool) - Whether catalog is required
  • SuperBundles (Dictionary<string, bool>) - SuperBundles in this catalog

InitFS / Memory File System

InitFS is a virtual file system stored in initfs_win32 that contains configuration files, scripts, and other data.
bool
Checks if a file exists in the memory file system
string
required
File path in InitFS
byte[]
Gets file data from the memory file system
string
required
File path in InitFS
Returns: File data, or null if not found
IEnumerable<string>
Enumerates all files in the memory file system
Common InitFS files:
  • Scripts/ - Configuration and script files
  • Dictionaries/ - Decompression dictionaries
  • Profiles/ - Profile definitions
  • Various configuration files

Source Management

void
Adds a file system source path to search
string
required
Relative path from BasePath
bool
default:"false"
Recursively add subdirectories containing package.mft

Manifest Operations

IEnumerable<DbObject>
Enumerates bundle data from manifest
Only available for games using manifest-based loading (FIFA 19+, Anthem, etc.)
ManifestBundleInfo
Gets manifest bundle information by name or hash
string
Bundle name
int
Bundle name hash
ManifestChunkInfo
Gets manifest chunk information by GUID

Utility Methods

ManifestFileRef
Gets a ManifestFileRef from an absolute path
string
Gets the file path for a CAS file
IDeobfuscator
Creates a deobfuscator instance for this game
Used internally for reading obfuscated files like layout.toc

Usage Examples

Game-Specific Behavior

Different Frostbite games use different file system layouts: Legacy Games (BF4, DAI, NFS, etc.)
  • Single Data directory
  • Simple catalog structure
  • No manifest system
Modern Games (FIFA 19+, BFV, Anthem)
  • Install chunks/packages
  • Manifest-based loading
  • Split superbundles across catalogs
  • May use encryption
Edge Case: NFS Edge
  • Uses .das files instead of CAS
  • Special DAS/DAL file format
The FileSystem class handles these differences automatically based on the loaded profile.

See Also