From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "magic" |
|---|
| subject | "Format:V8 code cache" |
|---|
| claim | "A V8 code cache starts with the little-endian u32 magic 0xC0DE0000 XOR ExternalReferenceTable::kSize, so bytes 2-3 are DE C0 as long as the table size fits in 16 bits (bytenode assumes this and also rejects a zero size in bytes 0-1), while bytes 0-1 hold the external reference table size of that V8 build." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:V8 code cache" |
|---|
| observed_in | |
|---|
|
|---|
| data | | bytes | "?? ?? DE C0" |
|---|
| mask | "00 00 FF FF" |
|---|
| offset | 0 |
|---|
| meaning | "SerializedData::kMagicNumber = 0xC0DE0000 ^ ExternalReferenceTable::kSize; the low 16 bits differ per V8 build, so a different build rejects the cache with 'magic number mismatch'" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "kMagicNumberOffset = 0; kMagicNumber = 0xC0DE0000 ^ ExternalReferenceTable::kSize; SetMagicNumber writes it at offset 0" |
|---|
| repo | "https://github.com/v8/v8" |
|---|
| commit | "bbe5d06b05d81051ebe50f8933f86ad477132911" |
|---|
| path | "src/snapshot/snapshot-data.h" |
|---|
| lines | "45-47, 62" |
|---|
|
| type | "source" |
|---|
| detail | "isBufferV8Bytecode requires bytes 2-3 equal DE C0 and bytes 0-1 not both zero" |
|---|
| repo | "https://github.com/bytenode/bytenode" |
|---|
| commit | "5562c8f31ce64cfbb4664ada71281feffe8172b9" |
|---|
| path | "lib/index.js" |
|---|
| lines | "24, 116-122" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Magic 0xC0DE0000 xor table size" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T02:26:47.995Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T12:42:13.722Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read snapshot-data.h 40-64 at bbe5d06 (kMagicNumberOffset 0, kMagicNumber = 0xC0DE0000 ^ ExternalReferenceTable::kSize, SetHeaderValue via WriteLittleEndianValue) and bytenode lib/index.js 116-122 at 5562c8f (bytes 0-1 not the zero-length table, bytes 2-4 equal DE C0). Mask 00 00 FF FF fits." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T08:26:46.514Z" |
|---|
| summary | "snapshot-data.h 45-47, 62: kMagicNumber = 0xC0DE0000 ^ ExternalReferenceTable::kSize, written little-endian at offset 0 (SetHeaderValue uses WriteLittleEndianValue). 'Bytes 2-3 are always DE C0'…" |
|---|
| changed | |
|---|
|
|
|---|