{"id":18443254,"url":"https://github.com/colinfinck/nt-hive","last_synced_at":"2025-09-03T07:39:28.441Z","repository":{"id":49795255,"uuid":"340726404","full_name":"ColinFinck/nt-hive","owner":"ColinFinck","description":"Rust crate for accessing keys, values, and data stored in Windows hive (registry) files.","archived":false,"fork":false,"pushed_at":"2025-01-21T20:58:59.000Z","size":223,"stargazers_count":47,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-02T00:26:00.332Z","etag":null,"topics":["no-std","registry","rust","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ColinFinck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-20T18:37:27.000Z","updated_at":"2025-02-17T19:20:05.000Z","dependencies_parsed_at":"2025-03-29T19:13:05.052Z","dependency_job_id":null,"html_url":"https://github.com/ColinFinck/nt-hive","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.016393442622950838","last_synced_commit":"41e6a87229bb198039d7b0b98615122befe08701"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ColinFinck/nt-hive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fnt-hive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fnt-hive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fnt-hive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fnt-hive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ColinFinck","download_url":"https://codeload.github.com/ColinFinck/nt-hive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ColinFinck%2Fnt-hive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273410219,"owners_count":25100449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["no-std","registry","rust","windows"],"created_at":"2024-11-06T06:46:46.833Z","updated_at":"2025-09-03T07:39:28.386Z","avatar_url":"https://github.com/ColinFinck.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"img/nt-hive.svg\"\u003e\n\n# nt-hive\n\n[![crates.io](https://img.shields.io/crates/v/nt-hive)](https://crates.io/crates/nt-hive)\n[![docs.rs](https://img.shields.io/docsrs/nt-hive)](https://docs.rs/nt-hive)\n[![license: GPL-2.0-or-later](https://img.shields.io/crates/l/nt-hive)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)\n\n*by Colin Finck \u003c\u003ccolin@reactos.org\u003e\u003e*\n\nThe *nt-hive* Rust crate provides a comfortable and safe interface for accessing keys, values, and data stored in *hive* files.\nHive files can be found in `C:\\Windows\\system32\\config` and store what is commonly called the *Windows registry*.\nThis crate supports the hive format that is used from Windows NT 4.0 up to the current Windows 10.\n\nnt-hive has been developed as part of a Rust bootloader project.\nIts current feature set is therefore aligned to the needs of a ReactOS/Windows bootloader.\n\n## Features\n* Support for reading keys, values, and data from any byte slice containing hive data (i.e. anything that implements [`zerocopy::SplitByteSlice`](https://docs.rs/zerocopy/0.3.0/zerocopy/trait.ByteSlice.html)).\n* Basic in-memory modifications of hive data (as [required for a bootloader](https://github.com/reactos/reactos/pull/1883)).\n* Iterators for keys and values to enable writing idiomatic Rust code.\n* Functions to find a specific subkey, subkey path, or value as efficient as possible (taking advantage of binary search for keys).\n* Error propagation through a custom `NtHiveError` type that implements `Display`.  \n  As a bootloader may hit corrupted hive files at some point, nt-hive outputs precise errors everywhere that refer to the faulty data byte.\n* Full functionality even in a `no_std` environment (with `alloc`, some limitations without `alloc`).\n* Static borrow checking everywhere. No mutexes or runtime borrowing.\n* Zero-copy data representations wherever possible.\n* No usage of `unsafe` anywhere. Checked arithmetic where needed.\n* Platform and endian independence.\n\n## Non-Goals\nFull write support is currently not a goal for nt-hive.\nThis would require a wholly different architecture, where nt-hive loads a hive into linked in-memory data structures, keeps track of changes, and can write changes back to disk (possibly extending the on-disk file).\nThe current focus on read-only access allows for a simpler architecture.\n\n## Examples\nThe following example reads the *List* value from the *ControlSet001\\Control\\ServiceGroupOrder* subkey of the *SYSTEM* hive, which is a real thing that happens during boot:\n\n```rust,no_run\nlet mut buffer = Vec::new();\nFile::open(\"SYSTEM\").unwrap().read_to_end(\u0026mut buffer).unwrap();\n\nlet hive = Hive::new(buffer.as_ref()).unwrap();\nlet root_key_node = hive.root_key_node().unwrap();\nlet key_node = root_key_node.subpath(\"ControlSet001\\\\Control\\\\ServiceGroupOrder\").unwrap().unwrap();\nlet key_value = key_node.value(\"List\").unwrap().unwrap();\n\nlet multi_sz_data = key_value.multi_string_data();\nif let Ok(vec) = multi_sz_data {\n    println!(\"Vector of REG_MULTI_SZ lines: {vec:?}\");\n}\n```\n\nCheck out the [docs](https://docs.rs/nt-hive), the tests, and the supplied *readhive* example application for more ideas how to use nt-hive.\n\n## Contributing and License\nContributions are currently preferred in the form of bug reports.\nIf you encounter a bug, an unexpected panic, or a potentially unsafe calculation, please [file a bug report](https://github.com/ColinFinck/nt-hive/issues).\n\nnt-hive is available under *GNU General Public License 2.0 or (at your option) any later version*.\nThis license fits well with the projects I'm planning to use nt-hive for, and should allow integration into any open-source project.  \nI may however put nt-hive under a more permissive license later if you [give me a good reason](mailto:colin@reactos.org).\n\nAs relicensing requires permission from every contributor, I only accept code contributions that are explicitly put under [Creative Commons Zero (CC0)](https://creativecommons.org/publicdomain/zero/1.0/).\nIf that is not an option for you, you are still very welcome to suggest your change in a bug report.\n\n## Further Resources\n* [Windows registry file format specification](https://github.com/msuhanov/regf/blob/master/Windows%20registry%20file%20format%20specification.md) by [Maxim Suhanov](https://dfir.ru/)\n* [cmlib library](https://github.com/reactos/reactos/tree/master/sdk/lib/cmlib) by the [ReactOS Project](https://reactos.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinfinck%2Fnt-hive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinfinck%2Fnt-hive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinfinck%2Fnt-hive/lists"}