# Registry hives

> Parse offline Windows Registry hive files into SQL rows for forensics, with transaction-log replay and deleted-key recovery

This page includes setup, release pins, credentials, hosting and verification evidence. [JSON alternative](https://query.farm/products/orchard/api/v1/connectors/reghive.json) contains the same setup facts for structured readers; choose one format.

## Runtime and release

Use DuckDB or Haybarn **2.0.1** with **VGI protocol 3.4**.
Catalog alias: `reghive`. Release: [v0.5.0](https://github.com/Query-farm/vgi-reghive/releases/tag/v0.5.0). Metadata generated: 2026-12-01T18:22:16+00:00.

## Choose where it runs

- On your machine: use an installation method below. No Query Farm account is required for local execution.
- Self-host: follow [the connector deployment instructions](https://github.com/Query-farm/vgi-reghive) and [connection guide](https://query.farm/vgi/connect-to-a-worker/). Use your real endpoint and its authentication settings.
- Query Farm hosted: [create a deployment](https://auth.queryfarm.cloud/console/new?worker=reghive). Hosting has a $10 monthly minimum per organization; usage and license fees may apply. Copy the deployment-specific ATTACH from the console.

## Service credentials and prerequisites

No service credentials are declared by this connector. Individual datasets, input files or deployments may have their own prerequisites.

Secret parameter required flags describe the upstream declaration; they do not override the service-level mode above. Keep secrets in environment variables or the deployment secret store. SQL values in angle brackets are placeholders, not automatic environment lookups. Native DuckDB and Haybarn 2.0.1 do not provide a SQL getenv() function, even when worker-supplied snippets mention it. Read environment variables in your application and pass credential values through client parameter bindings (for example, Python con.execute("CREATE SECRET stripe (TYPE stripe, api_key ?)", [os.environ["STRIPE_API_KEY"]]) after attaching the connector. Omit unused optional parameters and keep real values out of saved SQL and logs.

## Install the extension

In stock DuckDB:

```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;
```

In Haybarn:

```sql
INSTALL vgi FROM community;
LOAD vgi;
```

## Attach the connector

The local recipes below pin the catalog release for repeatability. A public demo endpoint follows its deployed release.

### From GitHub

Attach the release directly

Uses the verified release each time you attach the connector.

```sql
ATTACH 'reghive' AS reghive (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-reghive@v0.5.0'
);
```

### Docker

Attach the signed image

Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.

```sql
ATTACH 'reghive' AS reghive (
  TYPE vgi,
  LOCATION 'oci://ghcr.io/query-farm/vgi-reghive:0.5.0'
);
```

## Scan a collected hive and pull the Run-key persistence value it plants.

Service credentials required for this example: not declared by this example; check the connector requirements above.

```sql
SELECT key_path, value_name, value_data FROM reghive.main.read_hive(unhex('7265676601000000010000000000056936c0d501010000000300000000000000010000002000000000200000010000005c00530079007300740065006d0052006f006f0074005c00530079007300740065006d00330032005c0043006f006e006600690067005c0053004f00460054' || repeat('00', 397) || '1085c20e' || repeat('00', 3584) || '6862696e0000000000200000000000000000000000000000000000000000000090ffffff6e6b24000000056936c0d50100000000000000000100000000000000b0030000ffffffff00000000ffffffffffffffffffffffff00000000000000000000000000000000000000001e000000434d492d437265617465486976652d7b534f4654574152452d475549447d0000a8ffffff6e6b20000000056936c0d50100000000200000000100000000000000a0030000ffffffff00000000ffffffffffffffffffffffff000000000000000000000000000000000000000008000000536f667477617265a0ffffff6e6b20000000056936c0d5010000000090000000010000000000000090030000ffffffff00000000ffffffffffffffffffffffff0000000000000000000000000000000000000000090000004d6963726f736f667400000000000000a8ffffff6e6b20000000056936c0d50100000000e8000000010000000000000080030000ffffffff00000000ffffffffffffffffffffffff00000000000000000000000000000000000000000700000057696e646f777300a0ffffff6e6b20000000056936c0d5010000000048010000010000000000000070030000ffffffff00000000ffffffffffffffffffffffff00000000000000000000000000000000000000000e00000043757272656e7456657273696f6e0000a8ffffff6e6b20000000056936c0d50100000000a0010000000000000000000000000000ffffffff0500000058030000ffffffffffffffff00000000000000000000000000000000000000000300000052756e0000000000d0ffffff43003a005c00570069006e0064006f00770073005c006500760069006c002e00650078006500000000000000e0ffffff766b0700280000005802000001000000010000005570646174657200e0ffffff766b0500040000800200000004000000010000005374617274000000f0ffffff665544332211000000000000e0ffffff766b030008000000c80200000b000000010000004269670000000000e0ffffff61006c00700068006100000062006500740061000000000000000000e0ffffff766b040018000000f802000007000000010000004c69737400000000e0ffffff766b040004000080deadbeef0300000001000000426c6f6200000000e8ffffff88020000a8020000d80200001803000038030000f0ffffff6c6601000002000052756e00f0ffffff6c660100a001000043757272f0ffffff6c6601004801000057696e64f0ffffff6c660100e80000004d696372f0ffffff6c66010090000000536f6674180000007700610073002d0068006500720065000000000020000000766b050012000000c00300000100000001000000547261636500000008000000d8030000580000006e6b20000000056936c0d5010000000000000000000000000000000000000000ffffffff01000000f8030000ffffffffffffffff00000000000000000000000000000000000000000800000047686f73744b6579a81b' || repeat('00', 7078))::BLOB) WHERE value_name = 'Updater'
```

- [reghive.main.read_hive — table_function](https://query.farm/products/orchard/connectors/reghive/objects/table_function.bWFpbg.cmVhZF9oaXZl.md): exact declaration for this example.

Execution evidence: **captured_result**.

```json
{
  "status": "captured_result",
  "capturedAt": "2026-12-01T06:16:30+00:00",
  "engineVersion": "2.0.1",
  "protocolVersion": "3.4.0",
  "releaseTag": "v0.5.0",
  "sample": {
    "columns": [
      "key_path",
      "value_name",
      "value_data"
    ],
    "types": [
      "VARCHAR",
      "VARCHAR",
      "VARCHAR"
    ],
    "rows": [
      [
        "Software\\Microsoft\\Windows\\CurrentVersion\\Run",
        "Updater",
        "C:\\Windows\\evil.exe"
      ]
    ],
    "more": false
  }
}
```

## Connector reference

### Reghive — Windows Registry Hive Parsing for DFIR in SQL

**Parse Windows Registry hive files (the on-disk `regf` format) directly in DuckDB SQL** — `SYSTEM`, `SOFTWARE`, `NTUSER.DAT`, `SAM`, `SECURITY`, `UsrClass.dat`, and `AmCache.hve` — into typed key/value rows for digital forensics and incident response. ATTACH a directory of thousands of collected hives and run **one query** that joins registry evidence (Run-key persistence, Services, installed software, AmCache program-execution) to the rest of your detection surface — IOC feeds, CVE data, YARA, Sigma — with no per-host RegRipper invocation and no result-wrangling.

The differentiators over export-only tools are **transaction-log (`.LOG1`/`.LOG2`) replay** of dirty hives captured mid-write and **deleted-cell recovery** of keys/values from unallocated space (flagged `is_deleted`), both powered by the Apache-2.0 [`notatin`](https://github.com/strozfriedberg/notatin) parser. Every value is surfaced both as a coerced `value_data` string and the lossless `value_raw` bytes; per-key last-write timestamps are a first-class column.

**Sensitivity note.** `SAM`/`SECURITY` hives contain password-hash material. This worker exposes hive structure faithfully (so those bytes appear in `value_raw`) but **never decodes credentials** — pair it with `vgi-mask`/`vgi-pii` to redact before results leave the analyst's session.

**How you work with it.** Point it at a directory glob of collected hives for bulk triage, or hand it a single in-memory hive to drill into one subtree, key, or value; header and validity probes tell you up front whether a hive is dirty and needs transaction-log recovery. The worker opens no socket and makes no outbound calls — zero egress, safe for air-gapped evidence stores.

Format references: the [msuhanov regf specification](https://github.com/msuhanov/regf/blob/master/Windows%20registry%20file%20format%20specification.md) and Google Project Zero's "Windows Registry Adventure #5: regf".

## Find the exact SQL object

[Browse 9 object declarations](https://query.farm/products/orchard/api/v1/connectors/reghive/objects.json) or [search within this connector](https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=reghive&q=reghive).

Follow one format of each needed object for complete argument types, defaults, named flags, return columns and examples. Existing links above can replace another search. For questions about hosting, credentials or supported operations, stop once the documentation answers the question; SQL and unrelated object lookups are unnecessary.

## Verification and interpretation

- Missing, null, or undeclared metadata means unknown; do not invent defaults, credential scope, platform support or endpoint URLs.
- Search is keyword retrieval, not proof of a capability. Read the exact object declaration before generating SQL.
- A table and a table function can have the same name. Preserve parentheses and use the matching overload and schema.
- Service credentials, external data availability and deployment authentication are separate requirements.
- Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL.

```json
{
  "generatedAt": "2026-12-01T18:22:16+00:00",
  "repository": "https://github.com/Query-farm/vgi-reghive",
  "harvest": {
    "status": "ok",
    "method": "github-auto",
    "error": null,
    "vgi_version": "9773130dde"
  },
  "catalogVerification": {
    "verified": true,
    "status": "passed",
    "total": 2,
    "passed": 2,
    "failed": 0,
    "needs_credentials": 0,
    "location": "github-auto://Query-farm/vgi-reghive@v0.5.0",
    "transport": "github-auto",
    "environment": {
      "vgi_extension_version": "9773130dde",
      "haybarn_version": "2.0.1rc3",
      "engine_version": "v2.0.1",
      "python": "3.12.4",
      "platform": "darwin_arm64",
      "protocol_version": "3.4.0"
    },
    "checked_at": "2026-12-01T06:16:26+00:00"
  },
  "interpretation": "Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL."
}
```
