Search Shortcut cmd + k | ctrl + k

Binary format + entry-point probe in SQL — container (PE/ELF/Mach-O/fat) and architecture from headers, entry point with file offset and section, bounded against hostile input

Maintainer(s): alitrack

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.4.4 1.4.5 1.5.5 1.5.6 2.0.0
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL disasm FROM community;
LOAD disasm;

Example

INSTALL disasm FROM community;
LOAD disasm;

-- Container + architecture straight from the headers
SELECT disasm_format(from_hex('7f454c46')).container;   -- elf

-- Unrecognized blobs are total: container='raw', detail fields NULL
SELECT disasm_format(CAST('hello' AS BLOB)).container;      -- raw

-- Wire it to real files: SELECT disasm_entrypoint(read_blob('a.out'));

About disasm

disasm — binary triage in SQL

Total and bounded: adversarial section sizes are clamped, so hostile input never errors — unrecognized blobs come back as container='raw' with NULL detail fields.

Function Returns Notes
disasm_format(blob) STRUCT container (pe/elf/macho/fat-macho/raw), arch, mode, bits, endian, entry
disasm_entrypoint(blob) STRUCT arch, mode, vaddr, file_off, section

→ GitHub

Added Functions

function_name function_type description comment examples
disasm_entrypoint scalar NULL NULL  
disasm_format scalar NULL NULL  

Overloaded Functions

This extension does not add any function overloads.

Added Types

This extension does not add any types.

Added Settings

name description input_type scope aliases typed_value
temp_directory Set the directory to which temporary files are written. VARCHAR GLOBAL [] post.db.tmp
© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog