Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Windows thumbnail cache (thumbcache)

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

Windows Explorer's thumbcache_*.db files: a cache file starting with CMMM (entries carry CRC-64 checksums and the thumbnail image) and an index file starting with IMMM; format versions 20/21 (Vista/7) and 30/31/32 (Windows 8.0/8.1/10-11).

Windows Explorer stores thumbnails of pictures and other files in per-size database files under the user's profile (thumbcache_<size>.db, plus thumbcache_idx.db). Layout from libyal/libwtcdb documentation (LGPL-3 repo, GFDL text). Little endian, UTF-16LE strings without BOM. The thumbnail data is usually BMP, JPEG or PNG; the source notes sample entries with BMP ("BM6"), PNG and JPEG/JFIF signatures.

Two file types

  • Cache file (thumbcache_*.db): signature CMMM (43 4D 4D 4D) at offset 0; holds entries with the picture data.
  • Index file: signature IMMM; maps entry hashes to the entry offset in each cache file. The source labels the index file purpose and parts of its header as TODO.

Format versions

20 = Windows Vista, 21 = Windows 7, 30 = Windows 8.0, 31 = Windows 8.1, 32 = Windows 10 and 11.

Cache file header (24 bytes)

signature CMMM, format version (+4), cache type (+8), offset to first cache entry (+12, 0 if not set), offset to first available cache entry (+16), number of cache entries (+20, not always accurate). The cache type picks the file name: for versions 20/21, 0 = 32, 1 = 96, 2 = 256, 3 = 1024 (1024 x 768), 4 = sr; version 30 adds 16 and 48 and wide/exif; version 31 adds 1600 and wide_alternate; version 32 uses 16, 32, 48, 96, 256, 768, 1280, 1920, 2560, sr, wide, exif, wide_alternate, custom_stream (types 0-13).

Cache entry

Variable size, begins with CMMM, then the entry size (includes signature and size field), an 8-byte entry hash (algorithm unknown to the source; the identifier string sometimes equals it in hex), then in version 21: identifier string size (+16), padding size (+20), data size (+24), unknown (+28), data CRC-64 (+32), header CRC-64 (+40, computed over the first 40 bytes), identifier string at +48 (UTF-16LE, no terminator), padding, data. Version 20 has an 8-byte file extension (UTF-16) at +16, identifier string size +24, padding size +28, data size +32, unknown +36, data CRC-64 at +40, header CRC-64 at +48 (over the first 48 bytes), identifier string at +56. Version 30 and later: entry hash at +8, identifier string size +16, padding size +20, data size +24, two unknown fields at +28 and +32 (format version or 0, per the source), data CRC-64 at +40, header CRC-64 at +48 (over the first 48 bytes), identifier string at +56.

The identifier string can be the 64-bit hexadecimal ThumbnailCacheId without leading zeros. The CRC-64 polynomial is unknown to the source; its look-up table is stored in thumbcache.dll and the calculation uses initial value 0xFFFFFFFFFFFFFFFF but no final XOR. The last (first available) entry may span the rest of the file and be all zero bytes.

Index file

Header versions 20/21 (24 bytes): IMMM, version, unknown, entries used (+12), total entries (+16), unknown. Version 30 header is 28 bytes with the signature at +4. Index entry sizes: 40 (v20: hash 8, FILETIME last modified 8, flags 4, five 32-bit cache entry offsets), 32 (v21), 56 (v30, nine offsets), 64 (v31, eleven offsets), 72 (v32, fourteen offsets). An offset is relative to the file start, 0 if not set or 0xFFFFFFFF if the cache file holds no entry.

Code & repositories

  • https://github.com/libyal/libwtcdb @ 6c0d9c21e843b8a4332fcb6223154e3ced7cfd70 · license: LGPL-3.0-or-later (declared by the contributor; GitHub's detector did not recognize COPYING)
    libyal library for Windows Explorer thumbnail cache databases; documentation/Windows Explorer Thumbnail Cache database format.asciidoc.
    Tested on: source read, not run · checked 2026-10-19

See also

Format:Windows Shell Link (LNK), Format:Windows Jump Lists.