Repository navigation
Corefiles
ShadelessFox edited this page Sep 15, 2026
·
21 revisions
| Game | Format |
|---|---|
| Killzone | Core<1.77><PSX2> incomplete |
| Killzone HD | Core<1.79><PSX3> |
| Killzone: Liberation | RTTIBin 1.12 incomplete |
| Killzone 2 | RTTIBin 1.58 |
| Killzone 3, Until Dawn Beta | RTTIBin 1.73 |
| Killzone: Mercenary | RTTIBin 2.07 |
| Killzone Shadow Fall, Until Dawn | RTTIBin 2.12 * |
| RIGS: Mechanized Combat League | RTTIBin 2.19 * |
| Horizon Zero Dawn, Death Stranding | RTTIBinaryVersion 2 |
Note
All templates are listed in a format compatible with 010 Editor.
Warning
Not documented yet
void Align(uint inGranularity) {
local uint Size = -FTell() & (inGranularity - 1);
if (Size) {
struct (uint Size) {
ubyte Bytes[Size];
} Padding(Size) <style=sMarker, hidden=true>;
}
};
typedef enum <uint8> {
CoreFlag_HasInlineTextureData = 0x1,
CoreFlag_HasStream = 0x4
} CoreFlag;
typedef struct {
uint Size;
local uquad End = startof(Size) + sizeof(Size) + Size;
uint Count;
struct {
Align(4);
uint Length;
if (Length)
char Data[Length];
} Strings[Count] <read=(exists(Data) ? Data : "<empty>"), optimize=false>;
if (FTell() < End)
ubyte Padding[End - FTell()] <style=sSection4>;
Assert(End == FTell());
} StringTable;
typedef struct {
while (true) {
Align(4);
if (ReadInt() == -1) // HeaderSize and EndMarker
break;
struct {
uint HeaderSize;
uint Name <read=Str("%d (%s)", this, Strings.Strings[this].Data)>;
uint NumObjects;
typedef enum <uint> {
AttrFlag_Struct = 0x00000080,
AttrFlag_Ref = 0x00008000,
AttrFlag_CPtr = 0x00800000,
AttrFlag_Array = 0x80000000,
} AttrFlag;
typedef struct {
uint Name <read=Str("%d (%s)", this, Strings.Strings[this].Data)>;
struct {
uint TypeAndFlags <format=hex, hidden=true>;
local uint Type <format=hex> = TypeAndFlags & 0x7f7f7f7f;
local AttrFlag Flags <format=hex> = TypeAndFlags & 0x80808080;
} TypeAndFlags;
struct {
local int SizeAndAlignment <format=hex, hidden=true> = ReadInt();
uint Alignment : 4; // 1, 2, 4, or 8 bytes; otherwise defaults to 4.
uint Size : 28; // Byte size.
} SizeAndAlignment <read=(SizeAndAlignment == -1 ? "string-backed sentinel" : Str("alignment = %d, size = %d", Alignment, Size))>;
int Offset;
} Attr <read=Str("%c%c%c%c %s (%s)", TypeAndFlags.Type >> 24, TypeAndFlags.Type >> 16, TypeAndFlags.Type >> 8, TypeAndFlags.Type, Strings.Strings[this.Name].Data, EnumToString(TypeAndFlags.Flags))>;
struct {
uint NumDynamicCountSlots;
uint NumAttributes;
Attr Attributes[NumAttributes] <style=sSection1Accent, optimize=false>;
} Attributes;
uint HasObjectUuids;
uint HasStreamingInfo;
local uquad LocalHeaderOffset = FTell();
local uquad LocalDataOffset = startof(HeaderSize) + sizeof(HeaderSize) + HeaderSize;
struct {
for (local uquad i = 0; i < NumObjects; i++) {
struct {
FSeek(LocalHeaderOffset);
uint ObjectSize;
uint ObjectId; // Key in the load's object-ID map; used by internal Ref tokens.
if (HasObjectUuids)
GUID ObjectUuid;
if (HasStreamingInfo) {
uint StreamOffset; // Byte offset in the companion .CoreStream file.
uint StreamSize; // Byte length; zero means no registered payload.
}
FSeek(LocalDataOffset);
local uquad ObjectStart = FTell();
local uquad ObjectEnd = ObjectStart + ObjectSize;
switch (Strings.Strings[Name].Data) {
case "Texture":
RTTI_Texture Data;
break;
default:
ubyte Data[ObjectSize];
break;
}
LocalHeaderOffset += 8;
LocalHeaderOffset += HasObjectUuids ? 16 : 0;
LocalHeaderOffset += HasStreamingInfo ? 8 : 0;
Assert(FTell() <= ObjectEnd, "Object data exceeds its declared size");
Align(16);
Assert(FTell() == ObjectEnd, Str("%d != %d", FTell(), ObjectEnd));
LocalDataOffset = ObjectEnd;
} Object <read=Str("%d bytes", ObjectSize)>;
}
} Objects;
FSeek(LocalDataOffset);
} Group <read=Str("%s (%d)", Strings.Strings[Name].Data, this.NumObjects)>;
}
uint EndMarker <hidden=true>; Assert(EndMarker == -1);
} GroupTable;
BigEndian();
byte Magic[16]; Assert(Magic == "Core<1.79><PSX3>");
CoreFlag Flags <edit=flags>;
Align(4);
StringTable Strings;
GroupTable Groups;
Assert(FEof());Warning
Not documented yet
typedef struct {
switch (ReadUByte()) {
case 0x80:
ubyte pad;
uint value;
break;
case 0x81:
ubyte pad <hidden=true>;
ushort value;
break;
default:
ubyte value;
break;
}
} varint <read=Str("%d", varint_get(this))>;
uquad varint_get(varint& t) {
return t.value;
}
typedef struct {
byte version[15]; Assert(version == "RTTIBin<1.58> ");
ubyte endian;
if (endian) {
BigEndian();
} else {
LittleEndian();
}
uint pointer_map_size;
uint allocation_count;
uint vram_allocation_count;
ushort required_bin_count;
ushort required_vram_bin_count;
} rtti_header;
typedef struct {
varint count;
struct {
ubyte length;
char name[length];
} entry[varint_get(count)] <read=Str("%s", this.name), optimize=false>;
} rtti_info;
typedef struct (rtti_info& info) {
varint count;
if (varint_get(info.count) > 255) {
struct {
ushort value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
} else {
struct {
ubyte value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
}
} rtti_object_types;
typedef struct (rtti_object_types& object_types) {
struct {
GUID guid;
uint size;
uint unk0;
uint unk1;
uint unk2;
} entry[varint_get(object_types.count)];
} rtti_object_headers;
typedef struct {
varint count;
if (varint_get(count)) {
struct {
varint size;
varint alignment;
varint size2;
varint size3;
varint size4;
} entry[varint_get(count)] <optimize=false>;
}
} rtti_allocations;
typedef struct (rtti_info& info) {
if (ReadUByte() == 0) {
varint kind;
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
} else {
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
}
} rtti_atom_table;
typedef struct (rtti_info& info) {
varint count;
rtti_atom_table tables (info) [varint_get(count)] <optimize=false>;
} rtti_atom_tables;
rtti_header header;
rtti_info info;
rtti_object_types object_types (info);
rtti_object_headers object_headers (object_types);
rtti_allocations atom_table_allocations;
rtti_atom_tables atom_tables (info);
varint indirect_object_index;
rtti_allocations object_construction_allocations;typedef struct {
switch (ReadUByte()) {
case 0x80:
ubyte pad;
uint value;
break;
case 0x81:
ubyte pad <hidden=true>;
ushort value;
break;
default:
ubyte value;
break;
}
} varint <read=Str("%d", varint_get(this))>;
uquad varint_get(varint& t) {
return t.value;
}
typedef struct {
byte version[15]; Assert(version == "RTTIBin<1.73> ");
ubyte endian;
if (endian) {
BigEndian();
} else {
LittleEndian();
}
uint pointer_map_size;
uint allocation_count;
uint vram_allocation_count;
ushort required_bin_count;
ushort required_vram_bin_count;
} rtti_header;
typedef struct {
varint count;
struct {
ubyte length;
char name[length];
} entry[varint_get(count)] <read=Str("%s", this.name), optimize=false>;
} rtti_info;
typedef struct (rtti_info& info) {
varint count;
if (varint_get(info.count) > 255) {
struct {
ushort value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
} else {
struct {
ubyte value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
}
} rtti_object_types;
typedef struct (rtti_object_types& object_types) {
varint count; // total explicit objects
struct {
GUID guid;
uint size;
} entry[varint_get(object_types.count)];
} rtti_object_headers;
typedef struct {
varint count;
if (varint_get(count)) {
struct {
varint size;
varint alignment;
varint size2;
varint size3;
varint size4;
} entry[varint_get(count)] <optimize=false>;
}
} rtti_allocations;
typedef struct (rtti_info& info) {
if (ReadUByte() == 0) {
varint kind;
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
} else {
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
}
} rtti_atom_table;
typedef struct (rtti_info& info) {
varint count;
rtti_atom_table tables (info) [varint_get(count)] <optimize=false>;
} rtti_atom_tables;
rtti_header header;
rtti_info info;
rtti_object_types object_types (info);
rtti_object_headers object_headers (object_types);
rtti_allocations atom_table_allocations;
rtti_atom_tables atom_tables (info);
varint indirect_object_index;
rtti_allocations object_construction_allocations;typedef struct {
switch (ReadUByte()) {
case 0x80:
ubyte pad;
uint value;
break;
case 0x81:
ubyte pad <hidden=true>;
ushort value;
break;
default:
ubyte value;
break;
}
} varint <read=Str("%d", varint_get(this))>;
uquad varint_get(varint& t) {
return t.value;
}
typedef struct {
byte version[15]; Assert(version == "RTTIBin<2.07> ");
ubyte endian;
if (endian) {
BigEndian();
} else {
LittleEndian();
}
uint pointer_map_size;
uint allocation_count;
uint vram_allocation_count;
ushort required_bin_count;
ushort required_vram_bin_count;
ubyte unk_20[8];
} rtti_header;
typedef struct {
varint count;
struct {
ubyte length;
char name[length];
} entry[varint_get(count)] <read=Str("%s", this.name), optimize=false>;
} rtti_info;
typedef struct (rtti_info& info) {
varint count;
if (varint_get(info.count) > 255) {
struct {
ushort value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
} else {
struct {
ubyte value;
} entry[varint_get(count)] <read=Str("%s", info.entry[value].name)>;
}
} rtti_object_types;
typedef struct (rtti_object_types& object_types) {
varint count; // total explicit objects
struct {
GUID guid;
uint size;
} entry[varint_get(object_types.count)];
} rtti_object_headers;
typedef struct {
varint count;
if (varint_get(count)) {
struct {
varint size;
varint alignment;
varint size2;
varint size3;
varint size4;
} entry[varint_get(count)] <optimize=false>;
}
} rtti_allocations;
typedef struct (rtti_info& info) {
if (ReadUByte() == 0) {
varint kind;
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
} else {
varint type <read=Str("%s", info.entry[varint_get(this)].name)>;
varint count;
struct {
varint size;
ubyte data[varint_get(size)];
} data[varint_get(count)] <optimize=false>;
}
} rtti_atom_table;
typedef struct (rtti_info& info) {
varint count;
rtti_atom_table tables (info) [varint_get(count)] <optimize=false>;
} rtti_atom_tables;
rtti_header header;
rtti_info info;
rtti_object_types object_types (info);
rtti_object_headers object_headers (object_types);
rtti_allocations atom_table_allocations;
rtti_atom_tables atom_tables (info);
varint indirect_object_index;
rtti_allocations object_construction_allocations;typedef struct {
byte version[14]; Assert(version == "RTTIBin<2.12> ");
ubyte platform; Assert(platform == 3); // PINK
ubyte endian;
if (endian) {
BigEndian();
} else {
LittleEndian();
}
uint pointer_map_size;
uint string_table_count;
uint wide_string_table_count;
uint asset_count;
} rtti_header;
typedef struct {
uint count;
struct {
uint length;
char name[length];
GUID uuid;
} entry[count] <read=Str("%s", this.name), optimize=false>;
} rtti_info;
typedef struct (rtti_info& info) {
uint count;
uint indices[count] <read=Str("%s", info.entry[this].name)>;
} rtti_object_types;
typedef struct (rtti_object_types& object_types) {
uint count; // total explicit objects
struct {
GUID guid;
uint size;
} entry[object_types.count];
} rtti_object_headers;
rtti_header header;
rtti_info info;
rtti_object_types object_types (info);
rtti_object_headers object_headers (object_types);typedef struct {
byte version[14]; Assert(version == "RTTIBin<2.19> ");
ubyte platform; Assert(platform == 3); // PINK
ubyte endian;
if (endian) {
BigEndian();
} else {
LittleEndian();
}
uint pointer_map_size;
uint string_table_count;
uint wide_string_table_count;
uint asset_count;
} rtti_header;
typedef struct {
uint count;
struct {
uint length;
char name[length];
GUID uuid;
} entry[count] <read=Str("%s", this.name), optimize=false>;
} rtti_info;
typedef struct (rtti_info& info) {
uint count;
uint indices[count] <read=Str("%s", info.entry[this].name)>;
} rtti_object_types;
typedef struct (rtti_object_types& object_types) {
uint count; // total explicit objects
struct {
GUID guid;
uint size;
} entry[object_types.count];
} rtti_object_headers;
rtti_header header;
rtti_info info;
rtti_object_types object_types (info);
rtti_object_headers object_headers (object_types);The actual .core data is also additionally wrapped in a compressed archive:
LittleEndian();
uint32 magic; Assert(magic == 0xCB10C183);
uint32 chunk_size;
uint64 output_size;
ubyte checksum[16]; // MurmurHash3 of the decompressed data
local uint32 chunk_index;
local uint32 chunk_count = (output_size + chunk_size - 1) / chunk_size;
uint32 chunk_sizes[chunk_count];
struct {
for (chunk_index = 0; chunk_index < chunk_count; chunk_index++) {
struct { ubyte data[chunk_sizes[chunk_index]]; } chunk;
}
} chunks;Individual chunks are compressed using the LZ4 compression algorithm.
LittleEndian();
while (!FEof()) {
struct {
uquad type_id;
uint size;
ubyte data[size];
} entry;
}