Skip to content

Disassembler

Disassemble binaries and shellcode, then triage their sections, imports, strings, and MITRE ATT&CK capabilities

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/disasm/index.md to help me query Disassembler with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Disassemble an x64 shellcode blob and project the instruction address, mnemonic, and operands.

Example output · captured
Connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64')
Result
address mnemonic op_str
0 push rbp
1 mov rbp, rsp
4 ret

Quick start

Choose where to run Disassembler, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'disasm' AS disasm (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-disasm'
);

3. Run a query

query.sql
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64')
More example queries →
Technical details
Verified connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'disasm' AS disasm (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Disassemble PE/ELF/Mach-O binaries and shellcode into instruction rows, with section/import/string/capability triage for malware analysis.

Catalog

Everything disasm exposes once attached — read straight from the worker's released build.

disasm 1 schema
main 1 view · 7 functions

Disassembly, container-introspection, and malware-triage functions.

Schema examples (6)
Examples (6)

Disassemble an x64 shellcode blob and project the instruction address, mnemonic, and operands.

SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64');
Result
address mnemonic op_str
0 push rbp
1 mov rbp, rsp
4 ret

Probe a blob by its magic bytes and read back just the detected container format.

SELECT (disasm.main.format(from_hex('7f454c46'))).container AS container;

Count the heuristic MITRE ATT&CK capability hits on a suspicious command line.

SELECT count(*) AS n
FROM disasm.main.capabilities('powershell -enc ZQA='::BLOB);

Locate each string-based ATT&CK indicator in a sample: join capabilities() to strings() on the matched evidence to get the file offset of every flagged string (offsets 0, 18 and 56 here).

SELECT c.rule, c.attack_id, c.severity, s."offset", s.value
FROM disasm.main.capabilities('cmd.exe /c whoami\x00schtasks /create /tn upd /tr evil.exe\x00http://evil.example/c2'::BLOB) AS c
JOIN disasm.main.strings('cmd.exe /c whoami\x00schtasks /create /tn upd /tr evil.exe\x00http://evil.example/c2'::BLOB) AS s ON s.value = c.evidence
ORDER BY s."offset", c.rule;
2 more examples

Profile every executable section of a binary: join sections() to disassemble() by address range to count decoded instructions and calls per section next to its entropy (the hello-world Mach-O fixture: __text 8 instructions / 1 call, __stubs 3, __stub_helper 9).

SELECT s.name, round(s.entropy, 2) AS entropy, count(d.address) AS n_insns,
  count(d.address) FILTER (WHERE list_contains(d.groups, 'call')) AS n_calls
FROM disasm.main.sections('test/sql/data/hello-macho-arm64') AS s
LEFT JOIN disasm.main.disassemble('test/sql/data/hello-macho-arm64') AS d ON d.address >= s.vaddr AND d.address < s.vaddr + s.size
WHERE s.exec
GROUP BY s.name, s.vaddr, s.entropy
ORDER BY s.vaddr;

Check where a binary starts executing: join entrypoint() to sections() on the entry's section name to report that section's kind, exec flag and entropy (an entry point in a non-code or near-8-bit-entropy section suggests a packer; the fixture's entry is in __TEXT,__text, kind code).

SELECT ep.e.section, ep.e.vaddr AS entry_vaddr, s.kind, s.exec,
  round(s.entropy, 2) AS entropy
FROM (SELECT disasm.main.entrypoint('test/sql/data/hello-macho-arm64') AS e) AS ep
JOIN disasm.main.sections('test/sql/data/hello-macho-arm64') AS s ON s.name = ep.e.section
ORDER BY s.vaddr;
Views
supported_targets 1 example3 cols

The architecture / decode-mode tokens disassemble() accepts — browse it to discover valid arch / mode values without supplying a binary.

Columns
arch VARCHAR
Architecture token to pass as disassemble()'s arch argument (x86, arm, arm64, mips, ppc, sysz, riscv).
modes VARCHAR
Comma-separated mode tokens valid for this architecture, passed as disassemble()'s mode argument.
description VARCHAR
When and how to set mode for this architecture.
Example

List every architecture the disassemble() function accepts and the mode tokens valid for each.

SELECT arch, modes FROM disasm.main.supported_targets ORDER BY arch;
Link
Scalar functions
entrypoint (blob ANY) 2 examples

The container entry point and resolved (arch, mode): STRUCT(arch, mode, vaddr, file_off, section)

Arguments
blob ANY
The binary to resolve the entry point of: the raw bytes supplied inline, or a filesystem path to the file to read. Only headers are read; the bytes are never executed.
ReturnsSTRUCT of 5 fields
STRUCT 5 fields
  • archVARCHAR
  • modeVARCHAR
  • vaddrUBIGINT
  • file_offUBIGINT
  • sectionVARCHAR
Examples (2)

Resolve a blob's entry point; a raw blob yields NULL fields.

SELECT (disasm.main.entrypoint('not a binary'::BLOB)).arch AS arch;

Check where a binary starts executing: join entrypoint() to sections() on the entry's section name to report that section's kind, exec flag and entropy (an entry point in a non-code or near-8-bit-entropy section suggests a packer; the fixture's entry is in __TEXT,__text, kind code).

SELECT ep.e.section, ep.e.vaddr AS entry_vaddr, s.kind, s.exec,
  round(s.entropy, 2) AS entropy
FROM (SELECT disasm.main.entrypoint('test/sql/data/hello-macho-arm64') AS e) AS ep
JOIN disasm.main.sections('test/sql/data/hello-macho-arm64') AS s ON s.name = ep.e.section
ORDER BY s.vaddr;
Link
format (blob ANY) 1 example

Probe a blob's container/arch without disassembling: STRUCT(container, arch, mode, bits, endian, entry)

Arguments
blob ANY
The binary or shellcode to probe: the raw bytes supplied inline, or a filesystem path to the file to read. Only the container header is read; the bytes are never executed.
ReturnsSTRUCT of 6 fields
STRUCT 6 fields
  • containerVARCHAR
  • archVARCHAR
  • modeVARCHAR
  • bitsUTINYINT
  • endianVARCHAR
  • entryUBIGINT
Example

Probe the ELF magic and report the detected container type.

SELECT (disasm.main.format(from_hex('7f454c46'))).container AS container;
Link
Table functions
capabilities (blob ANY) 3 examples

Heuristic capability indicators mapped to MITRE ATT&CK (rule, attack_id, attack_name, severity, evidence) — not capa

Arguments
blob ANY
The binary or shellcode to analyze: either the raw bytes supplied inline, or a filesystem path to the file to open and read. The bytes are statically decoded only — never executed.
Returns columns
rule VARCHAR
Short heuristic name, e.g. 'inject:CreateRemoteThread'.
attack_id VARCHAR
MITRE ATT&CK technique id, e.g. 'T1055.002'.
attack_name VARCHAR
MITRE ATT&CK technique name.
severity VARCHAR
Advisory severity: info, low, medium, or high.
evidence VARCHAR
The import name, string, or instruction that matched.
Examples (3)

Surface ATT&CK-tagged capability indicators (rule, technique id, evidence) for a suspicious command line.

SELECT rule, attack_id, evidence
FROM disasm.main.capabilities('powershell.exe -EncodedCommand ZQA='::BLOB);

Locate each string-based ATT&CK indicator in a sample: join capabilities() to strings() on the matched evidence to get the file offset of every flagged string (offsets 0, 18 and 56 here).

SELECT c.rule, c.attack_id, c.severity, s."offset", s.value
FROM disasm.main.capabilities('cmd.exe /c whoami\x00schtasks /create /tn upd /tr evil.exe\x00http://evil.example/c2'::BLOB) AS c
JOIN disasm.main.strings('cmd.exe /c whoami\x00schtasks /create /tn upd /tr evil.exe\x00http://evil.example/c2'::BLOB) AS s ON s.value = c.evidence
ORDER BY s."offset", c.rule;
SELECT attack_id
FROM disasm.main.capabilities('powershell.exe -EncodedCommand ZQA='::BLOB)
WHERE attack_id = 'T1059.001'
LIMIT 1;
Link
disassemble (blob ANY, arch := VARCHAR, mode := VARCHAR, base := UBIGINT, section := VARCHAR) 3 examples

Disassemble a binary or shellcode blob into one row per machine instruction (address, size, bytes, mnemonic, op_str, groups)

Positional arguments
blob ANY
The binary or shellcode to analyze: either the raw bytes supplied inline, or a filesystem path to the file to open and read. The bytes are statically decoded only — never executed.
Named arguments
arch := VARCHAR
Override container detection or supply the arch for raw bytes: x86, arm, arm64, mips, ppc, sysz, or riscv. Required for a raw blob (no container to read).
mode := VARCHAR
Decode mode: x16, x32, x64 (x86 width), arm or thumb (32-bit ARM), or big/little (endianness for the other arches).
base := UBIGINT
Virtual/load address of the first byte (default = the section's VA, or 0 for a raw blob), so branch-relative operands print absolute targets.
section := VARCHAR
What to sweep: 'auto' (every executable section, the default), 'all' (the whole blob as raw bytes at base), or a section name such as '.text' or '__text'.
Returns columns
address UBIGINT
Absolute virtual address of the instruction (base + offset).
size UTINYINT
Instruction length in bytes (0 only for the synthetic error row).
bytes BLOB
The raw machine bytes of this instruction.
mnemonic VARCHAR
Instruction mnemonic, e.g. 'mov', 'call', 'bl'; '.byte' for an undecodable byte.
op_str VARCHAR
Operand text, e.g. 'rax, qword ptr [rip + 0x2f1a]'.
groups VARCHAR[]
Normalized instruction groups (call, jump, ret, int, privileged, branch_relative, fpu, sse, vm) for SQL filtering.
Examples (3)

Disassemble a tiny x64 shellcode blob and project the instruction address, mnemonic, and operands.

SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64');
Result
address mnemonic op_str
0 push rbp
1 mov rbp, rsp
4 ret
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64', base := 4096)
WHERE list_contains(groups, 'ret');
SELECT count(*) AS n
FROM disasm.main.disassemble(from_hex('90909090'), arch := 'x86', mode := 'x64');
Link
imports (blob ANY) 2 examples

Enumerate the imported symbols of a binary (library, name, ordinal, kind)

Arguments
blob ANY
The binary or shellcode to analyze: either the raw bytes supplied inline, or a filesystem path to the file to open and read. The bytes are statically decoded only — never executed.
Returns columns
library VARCHAR
Importing library/DLL/dylib name, or NULL when the container does not attribute the symbol to one (typical for ELF).
name VARCHAR
Imported symbol name, or NULL for an ordinal-only PE import.
ordinal INTEGER
Import ordinal (PE), or NULL.
kind VARCHAR
Import kind: named, ordinal, or delayed.
Examples (2)

Count the imported symbols of a blob (a raw blob has none); pass a real binary as inline bytes or a path to list them.

SELECT count(*) AS n FROM disasm.main.imports('not a binary'::BLOB);
SELECT count(*) AS n FROM disasm.main.imports('not a binary');
Link
sections (blob ANY) 3 examples

Enumerate the sections/segments of a binary (name, kind, vaddr, size, file_off, exec, entropy)

Arguments
blob ANY
The binary or shellcode to analyze: either the raw bytes supplied inline, or a filesystem path to the file to open and read. The bytes are statically decoded only — never executed.
Returns columns
name VARCHAR
Section/segment name, e.g. '.text' or '__TEXT,__text'.
kind VARCHAR
Section class: code, data, rodata, bss, debug, or other.
vaddr UBIGINT
Virtual address of the section (absolute; PE adds image base).
size UBIGINT
Declared section size in bytes (virtual size).
file_off UBIGINT
File offset of the section's bytes.
exec BOOLEAN
True if the section is executable (the disassemble(section := 'auto') set).
entropy DOUBLE
Shannon entropy (bits/byte, 0..8) over the section's file bytes; high values flag packing/encryption.
Examples (3)

Count the sections of a blob (a raw blob has none); pass a real binary as inline bytes or a path to enumerate them.

SELECT count(*) AS n FROM disasm.main.sections('not a binary'::BLOB);

Profile every executable section of a binary: join sections() to disassemble() by address range to count decoded instructions and calls per section next to its entropy (the hello-world Mach-O fixture: __text 8 instructions / 1 call, __stubs 3, __stub_helper 9).

SELECT s.name, round(s.entropy, 2) AS entropy, count(d.address) AS n_insns,
  count(d.address) FILTER (WHERE list_contains(d.groups, 'call')) AS n_calls
FROM disasm.main.sections('test/sql/data/hello-macho-arm64') AS s
LEFT JOIN disasm.main.disassemble('test/sql/data/hello-macho-arm64') AS d ON d.address >= s.vaddr AND d.address < s.vaddr + s.size
WHERE s.exec
GROUP BY s.name, s.vaddr, s.entropy
ORDER BY s.vaddr;
SELECT count(*) AS n FROM disasm.main.sections('not a binary');
Link
strings (blob ANY, min_len := UBIGINT) 2 examples

Extract printable ASCII and UTF-16LE strings from a blob (offset, encoding, value)

Positional arguments
blob ANY
The binary or shellcode to analyze: either the raw bytes supplied inline, or a filesystem path to the file to open and read. The bytes are statically decoded only — never executed.
Named arguments
min_len := UBIGINT
Minimum run length to report (default 4). Shorter printable runs are ignored.
Returns columns
offset UBIGINT
File offset of the first byte of the string run.
encoding VARCHAR
Encoding of the run: ascii or utf16le.
value VARCHAR
The decoded printable string (truncated to a bounded length).
Examples (2)

Extract printable strings (length ≥ 6) from a blob, ordered by file offset.

SELECT "offset", encoding, value
FROM disasm.main.strings('cmd.exe /c whoami'::BLOB, min_len := 6)
ORDER BY "offset";
SELECT value
FROM disasm.main.strings('hello world embedded text'::BLOB)
WHERE encoding = 'ascii'
ORDER BY "offset"
LIMIT 1;
Link

Try these queries

Probe a blob by its magic bytes and read back just the detected container format.

SELECT (disasm.main.format(from_hex('7f454c46'))).container AS container

Uses format

Count the heuristic MITRE ATT&CK capability hits on a suspicious command line.

SELECT count(*) AS n
FROM disasm.main.capabilities('powershell -enc ZQA='::BLOB)

Uses capabilities

Profile every executable section of a binary: join sections() to disassemble() by address range to count decoded instructions and calls per section next to its entropy (the hello-world Mach-O fixture: __text 8 instructions / 1 call, __stubs 3, __stub_helper 9).

SELECT s.name, round(s.entropy, 2) AS entropy, count(d.address) AS n_insns,
  count(d.address) FILTER (WHERE list_contains(d.groups, 'call')) AS n_calls
FROM disasm.main.sections('test/sql/data/hello-macho-arm64') AS s
LEFT JOIN disasm.main.disassemble('test/sql/data/hello-macho-arm64') AS d ON d.address >= s.vaddr AND d.address < s.vaddr + s.size
WHERE s.exec
GROUP BY s.name, s.vaddr, s.entropy
ORDER BY s.vaddr;

Uses sectionsdisassemble

Check where a binary starts executing: join entrypoint() to sections() on the entry's section name to report that section's kind, exec flag and entropy (an entry point in a non-code or near-8-bit-entropy section suggests a packer; the fixture's entry is in __TEXT,__text, kind code).

SELECT ep.e.section, ep.e.vaddr AS entry_vaddr, s.kind, s.exec,
  round(s.entropy, 2) AS entropy
FROM (SELECT disasm.main.entrypoint('test/sql/data/hello-macho-arm64') AS e) AS ep
JOIN disasm.main.sections('test/sql/data/hello-macho-arm64') AS s ON s.name = ep.e.section
ORDER BY s.vaddr;

Uses entrypointsections

List every architecture the disassemble() function accepts and the mode tokens valid for each.

SELECT arch, modes FROM disasm.main.supported_targets ORDER BY arch;

Uses supported_targets

Count the imported symbols of a blob (a raw blob has none); pass a real binary as inline bytes or a path to list them.

SELECT count(*) AS n FROM disasm.main.imports('not a binary'::BLOB);

Uses imports

11 more examples in the Catalog, each listed under the table or function it uses.

Disassembler is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.