SQLite database file repurposed as Linux executable via ELF schema in SQLite tables
A proof-of-concept interpreter extracts and runs ELF components stored in a SQLite database file whose application ID is set to 'SELF'.
2 sources · cross-referenced
- A SQLite database file can be formatted to contain an ELF executable by storing its components in SQLite tables.
- The SQLite file’s 4-byte application ID at byte 68 is set to 'SELF' to signal the custom format.
- An interpreter named self-exec extracts and executes the ELF pieces from the SQLite file.
- Linux’s binfmt_misc can register the pattern so the kernel executes such files directly.
Farid Zakaria describes a Linux-focused technique that turns a SQLite database file into a directly executable binary by encoding the ELF components as rows in SQLite tables. The method sets the SQLite file format’s 4-byte application ID—located 68 bytes into the file—to the string SELF, indicating a Structured Executable & Linkable Format payload.
The custom schema defines tables that map to ELF sections such as headers, program headers, and sections, allowing the SQLite file to mirror the structure of a traditional ELF executable. Zakaria provides a reference schema and a C-based interpreter called self-exec that reads the SQLite file, reconstructs the ELF components, and executes them.
To make the kernel recognize and run such files automatically, the approach leverages Linux’s binfmt_misc mechanism. By writing a registration string to /proc/sys/fs/binfmt_misc/register, the system can be configured to invoke self-exec whenever it encounters a file whose application ID matches SELF, enabling transparent execution of SQLite-based binaries.
- Aug 25, 2026 · OpenAI — News
OpenAI outlines infrastructure and model strategy to scale ‘abundant intelligence’
Trust72 - Aug 25, 2026 · OpenAI — News
OpenAI disrupts covert influence campaign using AI-generated content
Trust79 - Aug 23, 2026 · Simon Willison — everything
Linus Torvalds describes AI as a "tireless helper" in Linux kernel debugging session
Trust84