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
- Query Farm hosting
- Available · $10/month organization minimum
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')
| 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.
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;
INSTALL vgi FROM community;
LOAD vgi;
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'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'disasm' AS disasm (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-disasm:0.5.0'
);
3. Run a query
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64')
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'disasm' AS disasm
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64')
Query Farm operates Disassembler for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use disasm as the catalog alias for the query below.
4. Run a query
SELECT address, mnemonic, op_str
FROM disasm.main.disassemble(from_hex('554889e5c3'), arch := 'x86', mode := 'x64')
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
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]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'disasm' AS disasm (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-disasm:0.5.0'
);
Overview
Disassemble PE/ELF/Mach-O binaries and shellcode into instruction rows, with section/import/string/capability triage for malware analysis.
Disassemble PE/ELF/Mach-O binaries and raw shellcode directly in DuckDB SQL — one instruction row per machine instruction, with section, import, string, and heuristic MITRE ATT&CK capability relations alongside. The disasm worker is driven by Capstone with container parsing by goblin, and is built for fleet-scale, in-SQL triage: disassemble and capability-tag thousands of samples and join the instruction stats and ATT&CK tags to the rest of your security tables — with no per-sample tooling and zero egress.
It pairs with vgi-pe (static PE/ELF/Mach-O metadata), vgi-yara (rule hits), and vgi-ioc (indicators) in a VGI security bundle. The worker is pure static compute over the input BLOB — it never executes the sample, making it safe for air-gapped / regulated malware repositories.
How it works. You supply a sample as inline bytes or a filesystem path; the worker sniffs the container, resolves architecture and mode, statically decodes the executable sections, and tags heuristic behaviours against MITRE ATT&CK — all as ordinary SQL relations you can filter, aggregate, and join. Nothing is ever run or emulated. See the source repository for the full instruction/section/import/string/capability schema and licensing.
Catalog
Everything disasm exposes once attached — read straight from the worker's
released build.
main 1 view · 7 functions
Disassembly, container-introspection, and malware-triage functions.
Schema 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');
| 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;
supported_targets
The architecture / decode-mode tokens disassemble() accepts — browse it to discover valid arch / mode values without supplying a binary.
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;
entrypoint (blob ANY)
The container entry point and resolved (arch, mode): STRUCT(arch, mode, vaddr, file_off, section)
-
archVARCHAR
-
modeVARCHAR
-
vaddrUBIGINT
-
file_offUBIGINT
-
sectionVARCHAR
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;
format (blob ANY)
Probe a blob's container/arch without disassembling: STRUCT(container, arch, mode, bits, endian, entry)
-
containerVARCHAR
-
archVARCHAR
-
modeVARCHAR
-
bitsUTINYINT
-
endianVARCHAR
-
entryUBIGINT
Probe the ELF magic and report the detected container type.
SELECT (disasm.main.format(from_hex('7f454c46'))).container AS container;
capabilities (blob ANY)
Heuristic capability indicators mapped to MITRE ATT&CK (rule, attack_id, attack_name, severity, evidence) — not capa
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;
disassemble (blob ANY, arch := VARCHAR, mode := VARCHAR, base := UBIGINT, section := VARCHAR)
Disassemble a binary or shellcode blob into one row per machine instruction (address, size, bytes, mnemonic, op_str, groups)
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');
| 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');
imports (blob ANY)
Enumerate the imported symbols of a binary (library, name, ordinal, kind)
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');
sections (blob ANY)
Enumerate the sections/segments of a binary (name, kind, vaddr, size, file_off, exec, entropy)
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');
strings (blob ANY, min_len := UBIGINT)
Extract printable ASCII and UTF-16LE strings from a blob (offset, encoding, value)
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;
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.
Related workers
PE executables
Security & forensics
Inspect PE, ELF and Mach-O executables for malware triage without ever running them
TLS fingerprints
Security & forensics
Compute JA3, JA3S, and JA4 TLS fingerprints from raw handshake bytes or extracted fields
Windows event logs (EVTX)
Security & forensics
Parse Windows .evtx event-log files into queryable SQL rows for forensics and incident response