Skip to content

.BIN (Resident Evil 2)

Patrice Mandin edited this page Jun 25, 2020 · 2 revisions

Table of Contents

Games

The .BIN file format is used to store different files, with many different formats.

Structure

The values are stored in Little-Endian order.

Resident Evil 2 PC, common/bin/espdata1.bin

Same format as common/bin/roomcut.bin . However, some offsets which are 0 must be ignored (skipped).

Resident Evil 2 PC, common/bin/espdata2.bin

Same format as common/bin/roomcut.bin . However, some offsets which are 0 must be ignored (skipped).

Resident Evil 2 PC, common/bin/itemdata.bin

Same format as common/bin/roomcut.bin

Resident Evil 2 PC, common/bin/roomcut.bin

This file contains several ADT images concatenated one after the other. It starts with an array of unsigned long offsets to each ADT image in the archive file.

The number of images in the archive is thus the first offset/4, which is also the number of offsets stored at the start of the archive file.

Each ADT file offset sits in this array at the position given by:

(stage-1)*512 + room*16 + camera
Thus it means max 16 different camera angles per room, and max 32 rooms per stage.

Each ADT depacked file, contain 2 files: one raw 320x256 16 bits raw image (for the background), followed by a TIM image (mostly 320x128) which contains the masks for the background.

Resident Evil 2 PC, common/datp/espcore.bin

This file contains several TIM images concatenated one after the other.

Resident Evil 2 PC, common/file/filexx.bin

These files contain several ADT images concatened one after the other. It starts with the following header:

typedef struct {
	unsigned long offsets[32];	/* Offsets to embedded ADT image in this file, or NULL if no ADT file */
} bin_adt_collection_t;

Note: the offsets are relative to the end of the header, so you must add 0x80 to the offsets stored in the array.

Resident Evil 2 PS1 demo, dat/*.bin

These files contain several embedded files. Each file has the following header:

typedef struct {
	unsigned long unknown0;
	unsigned long length;	/* File length */
	unsigned long num_blocks;	/* Number of blocks (0x800 bytes) used to store file, including this header */
	unsigned long unknown1[1+12];
	unsigned char filename[0x800-0x40];	/* File name */
} re2ps1demo_datbin_header_t;