Simon Willison’s Weblog

Subscribe

Monday, 24th August 2026

Sighting 10:47 AM – 11:33 AM — Great Cormorant, Grey Heron, in Devon, England, GB
Great Cormorant
Great Cormorant
Great Cormorant
Great Cormorant
Grey Heron
Grey Heron

Your executable is a SQLite database (via) Farid Zakaria describes a neat Linux pattern for creating a SQLite database file that can be directly used as an executable binary.

The trick sets the SQLite file format's 4-byte application ID (68 bytes into the file) to SELF, standing for Structured Executable & Linkable Format. The various components of the ELF executable format are then arranged into a number of different SQLite tables, using this schema.

Their self-exec interpreter (C code here) can then extract and execute the necessary pieces.

You can additionally use a Linux mechanism called binfmt_misc to teach the kernel to execute that any time it encounters an executable matching that binary pattern. Farid uses NixOS here, but without NixOS I think registration looks something like this:

printf '%s\n' ':self:M:68:SELF::/usr/local/bin/self-exec:' \
  > /proc/sys/fs/binfmt_misc/register

# 11:38 am / c, linux, sqlite

Sunday, 23rd August 2026

2026 » August

MTWTFSS
     12
3456789
10111213141516
17181920212223
24252627282930
31