Overview
TheFileSystem 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
Creates a new FileSystem instance for a game installation
Path to the game installation directoryExample:
@"C:\Program Files (x86)\Origin Games\Battlefield 5"Initialization
Initializes the file system by loading layout.toc and initfsThis method:
Encryption key for games that use encrypted InitFS
- Processes layout.toc (base and patch)
- Loads catalogs from install manifest
- Loads InitFS memory file system
- Merges patch and base data
Properties
Game installation directory path
Path to the cache file for this profile
Base version number from layout.toc
Head version number from layout.toc (current patch level)
Total number of superbundles
Enumerable collection of all superbundle names
Total number of catalogs
Enumerable collection of all catalog names
Path Resolution
Resolves a game-relative path to an absolute file system pathReturns: Absolute file system path, or empty string if not foundSupported prefixes:
Game-relative path using forward slashes
native_data/- Base game datanative_patch/- Patch data- No prefix - Searches both locations
Resolves a ManifestFileRef to an absolute path
Manifest file reference
Catalog Management
Gets the catalog name from a ManifestFileRef
Enumerates detailed catalog informationCatalogInfo Properties:
Id(Guid) - Unique catalog identifierName(string) - Catalog path nameAlwaysInstalled(bool) - Whether catalog is requiredSuperBundles(Dictionary<string, bool>) - SuperBundles in this catalog
InitFS / Memory File System
InitFS is a virtual file system stored ininitfs_win32 that contains configuration files, scripts, and other data.
Gets file data from the memory file systemReturns: File data, or
File path in InitFS
null if not foundEnumerates all files in the memory file systemCommon InitFS files:
Scripts/- Configuration and script filesDictionaries/- Decompression dictionariesProfiles/- Profile definitions- Various configuration files
Source Management
Manifest Operations
Enumerates bundle data from manifestOnly available for games using manifest-based loading (FIFA 19+, Anthem, etc.)
Gets manifest chunk information by GUID
Utility Methods
Gets a ManifestFileRef from an absolute path
Gets the file path for a CAS file
Creates a deobfuscator instance for this gameUsed 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
Datadirectory - Simple catalog structure
- No manifest system
- Install chunks/packages
- Manifest-based loading
- Split superbundles across catalogs
- May use encryption
- Uses
.dasfiles instead of CAS - Special DAS/DAL file format
See Also
- ResourceManager API - Resource data loading
- AssetManager API - Asset management
- FrostySdk Namespace - Core types and utilities