From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "magic" |
|---|
| subject | "Format:NewGRF" |
|---|
| claim | "A NewGRF container version 2 starts with a u16 0 followed by the bytes 'GRF' 82 0D 0A 1A 0A; any other first u16 means container version 1 (no header)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:NewGRF" |
|---|
| observed_in | |
|---|
|
|---|
| data | | bytes | "00 00 47 52 46 82 0D 0A 1A 0A" |
|---|
| offset | 0 |
|---|
| meaning | "NewGRF container version 2" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "_grf_cont_v2_sig and GetGRFContainerVersion" |
|---|
| repo | "https://github.com/OpenTTD/OpenTTD" |
|---|
| commit | "364d9b12b082b424de46423219188a52baf4e529" |
|---|
| path | "src/spriteloader/sprite_file.cpp" |
|---|
| lines | "15-39" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "container version 2 signature" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T18:42:33.417Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T09:12:57.612Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read sprite_file.cpp at the cited commit: GetGRFContainerVersion reads a word, if 0 compares the next 8 bytes 'G','R','F',0x82,0x0D,0x0A,0x1A,0x0A, else rewinds and returns container version 1. Note: the 8-byte signature is read after the 2 zero bytes, so it sits at offset 2." |
|---|
|
|
|---|