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:Dart kernel

From ReverseEngineering.wiki
Format
Magic 90ABCDEF (uint32 0x90ABCDEF, big-endian byte order in the file)
Extensions .dill, kernel_blob.bin
Endianness big
License BSD-3-Clause (dart-lang/sdk)
Website https://github.com/dart-lang/sdk/blob/main/pkg/kernel/binary.md
On this wiki Facts · Code · Notes · Topics

Dart Kernel binary (.dill): the intermediate representation the Dart front end writes; it starts with the u32 magic 0x90ABCDEF and a format version, and is what JIT and debug Flutter builds load instead of an AOT snapshot.

Identification

A Dart kernel component file (conventionally .dill) begins with the 4 bytes 90 AB CD EF (ComponentFile = 0x90ABCDEF in pkg/kernel/lib/binary/tag.dart), then a u32 format version, then a 10-byte short SDK hash. At dart-lang/sdk commit 689733bf0d0c the format version is 141 (BinaryFormatVersion); the source comment says to keep it in sync with runtime/vm/kernel_binary.h and pkg/kernel/binary.md. The VM refuses a kernel file whose version it does not support. pkg/kernel/binary.md line 49 defines UInt32 as a big-endian 32-bit unsigned integer, so the header words are big-endian (the magic reads 90 AB CD EF in a hex dump).

Layout

From pkg/kernel/binary.md (type ComponentFile): magic, formatVersion, Byte[10] shortSdkHash, problemsAsJson, libraries, the source map (uri to source text and line starts), constants, constant mapping, canonical names, metadata payloads and mappings, the string table, and a ComponentIndex at the end. The index is made of fixed 32-bit words so it can be read from the file end: the last word is the component file size in bytes, the one before it the library count, preceded by libraryCount + 1 library offsets, the main method reference and offsets for the source table, constant table, canonical names, metadata, string table and the start of the index. A reader can therefore jump to any library without parsing the whole file.

Where it shows up

In release Flutter apps the Dart code is an AOT snapshot instead (see Format:Dart AOT snapshot). Unverified: Flutter debug and profile APKs carry the kernel in assets/flutter_assets/kernel_blob.bin and the engine loads it with the JIT; check the APK of a debug build. A kernel file keeps full library, class and member names and, when sources are included in the source table, the Dart source text, so a debug build can be read with dart tooling (for example the dump_kernel tool under pkg/vm/bin in the SDK: Unverified) instead of a disassembler.

See Library:Flutter and Technique:Cross-platform app frameworks.

Code & repositories

The SDK source is listed on Format:Dart AOT snapshot.