From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PHP OPcache file cache" |
|---|
| claim | "Each OPcache file-cache .bin starts with zend_file_cache_metainfo: char magic[8]='OPCACHE\0', char system_id[32], size_t mem_size, size_t str_size, size_t script_offset, accel_time_t timestamp, uint32_t checksum; then mem_size bytes of serialized script and str_size bytes of strings. Checksum is Adler-32 over those two parts." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PHP OPcache file cache" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "zend_file_cache_metainfo" |
|---|
| size_min | 76 |
|---|
| abi | "native C layout; size_t and accel_time_t are platform-sized" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 8 |
|---|
| type | "char[8]" |
|---|
| name | "magic" |
|---|
|
| offset | "0x8" |
|---|
| size | 32 |
|---|
| type | "char[32]" |
|---|
| name | "system_id" |
|---|
|
| offset | "0x28" |
|---|
| size | 8 |
|---|
| type | "size_t" |
|---|
| name | "mem_size" |
|---|
| condition | "64-bit build" |
|---|
|
| offset | "0x30" |
|---|
| size | 8 |
|---|
| type | "size_t" |
|---|
| name | "str_size" |
|---|
| condition | "64-bit build" |
|---|
|
| offset | "0x38" |
|---|
| size | 8 |
|---|
| type | "size_t" |
|---|
| name | "script_offset" |
|---|
| condition | "64-bit build" |
|---|
|
| offset | "0x40" |
|---|
| size | 8 |
|---|
| type | "accel_time_t" |
|---|
| name | "timestamp" |
|---|
| condition | "64-bit build; width of accel_time_t not read" |
|---|
|
| offset | "0x48" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "checksum" |
|---|
| condition | "64-bit build, if accel_time_t is 8 bytes" |
|---|
|
|
|---|
| size_max | 80 |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "struct definition, serialize setting magic/system_id/mem_size/script_offset, Adler-32 checksum computation, load-time magic and system_id checks, checksum verification under file_cache_consistency_checks." |
|---|
| repo | "php/php-src" |
|---|
| commit | "b7256eee3018928d265830e5f523dcc848dea2b6" |
|---|
| path | "ext/opcache/zend_file_cache.c" |
|---|
| lines | "191-199, 1027-1031, 1230-1231, 1975-1990, 2045-2048" |
|---|
|
| type | "source" |
|---|
| detail | "struct member order read again; 64-bit offsets 0x28/0x30/0x38/0x40/0x48 put the end of checksum at 0x4C, sizeof is rounded up to 8 (80); accel_time_t is unsigned __int64 on Windows and time_t elsewhere (ZendAccelerator.h)" |
|---|
| repo | "php/php-src" |
|---|
| commit | "b7256eee3018928d265830e5f523dcc848dea2b6" |
|---|
| path | "ext/opcache/zend_file_cache.c" |
|---|
| lines | "191-199" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "zend file cache metainfo" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T07:53:50.787Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:16:55.947Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read zend_file_cache_metainfo and the writer (sizeof(*info) written first) and loader (magic 'OPCACHE' memcmp of 8) in zend_file_cache.c at the cited commit; 64-bit offsets re-summed: checksum ends at 0x4C, sizeof 80." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T08:02:22.342Z" |
|---|
| summary | "declared size_min 68 did not match the last field: with the 64-bit layout checksum ends at 0x4C (76 bytes), padded to 80 by alignment" |
|---|
| changed | |
|---|
|
|
|---|