Filetype:File Database

From Imagisphere
Jump to navigation Jump to search

This page is a work in progress.
As a result, the layout and/or content herein may be subject to change.

The File Database filetype or map is a binary file format used by LittleBigPlanet games to store a list of assets and their metadata, and is used to load all of the files into the game. Common map files include the blurayguids.map which is the base map file, and brg_patch.map which is the patch map file.

Structure

The file consists of a header followed by a sequential list of file entries.

Header

The header is 8 bytes long and contains two 32-bit unsigned integers in big-endian format.

Offset Length Type Description
0 4 u32 Revision: The version of the file format. The high 16 bits (>> 0x10) determine the variant. If the value is >= 0x148, it is an LBP3 map.
4 4 u32 Count: The number of entries in the file.

Entries

Each entry represents a file or asset. The structure of the entry depends on the revision of the file.

Path Length

The length of the file path string.

Type Game Length
u16 LBP3 2 bytes
u32 LBP1/2 4 bytes

Path

A UTF-8 encoded string representing the file path. The length is defined by the preceding path_len field.

Timestamp

The Unix timestamp of the file.

Type Game Length
u16 LBP3 4 bytes
u32 LBP1/2 8 bytes

File Size

A 32-bit unsigned integer representing the size of the file in bytes.

SHA1

A 20-byte array containing the SHA-1 hash of the file content.

GUID

A 32-bit unsigned integer representing the Global Unique Identifier for the asset.

Summary of Entry Layout

Field Type (LBP3) Type (LBP1/2) Length
path_len u16 u32 2/4 bytes
path char[] path_len bytes
timestamp u32 s64 4/8 bytes
file_size u32 4 bytes
sha1 u8[20] 20 bytes
guid u32 4 bytes

Example

An example of a parsed entry:

  • Path Length: 28 bytes
  • Path: gamedata/audio/danish/voiceover.fsb
  • Time: 2010-04-26 12:31:56 UTC (Unix Epoch: 1272285171)
  • File Size: 11460544 bytes
  • SHA1: df7c600f41b1c70d6d62b2fd7bd2f3ce8553dd77
  • GUID: 60383