Skip to content

Update registry read and write eldritch functions to merge hive and path#2040

Closed
hulto wants to merge 21 commits intomainfrom
update-reg-eldritch-functions-11136848008787341416
Closed

Update registry read and write eldritch functions to merge hive and path#2040
hulto wants to merge 21 commits intomainfrom
update-reg-eldritch-functions-11136848008787341416

Conversation

@hulto
Copy link
Collaborator

@hulto hulto commented Mar 7, 2026

The registry read and write functions in the eldritch standard library have been updated to accept a single, consolidated path argument instead of separate hive and path arguments. This is achieved by extracting the hive prefix from the path string.

Additionally, the functions now support shortened hive aliases such as HKLM and HKCU, making it easier for users to write and execute scripts without having to specify the full HKEY_LOCAL_MACHINE string.

The get_registry and enable_rdp tomes have also been updated to utilize this new functionality. All relevant Rust tests have been updated and run successfully.


PR created automatically by Jules for task 11136848008787341416 started by @hulto

- Modify `get_reg`, `write_reg_hex`, `write_reg_int`, and `write_reg_str` in `eldritch-libsys` to take a single `path` parameter instead of separate `hive` and `path`.
- Introduce `parse_registry_path` to split the combined path into a hive and subkey.
- Support shortened hive aliases like `HKLM`, `HKCU`, etc. alongside the expanded versions.
- Update `std` and `fake` implementations, as well as associated test files.
- Update `get_registry` and `enable_rdp` tomes (`main.eldritch` and `metadata.yml`) to use the new single path argument.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2740    ±0 2740    ±0 0    ±0 0    ±0 0    ±0 0    ±0 1ms    ±0

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1704 2740 2740 0 0 0 0 39.5s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2740 0 0 5.5s

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestDockerExecutor_Build_ContextCancellation 1 5.5s 5.5s
eldritch-libsys: std::dll_inject_impl::tests::test_dll_inject_simple 1 5.1s 5.1s
TestInteractiveShell 1 5.1s 5.1s
TestOtherStreamOutput 1 5.0s 5.0s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
imix::bin/imix: install::tests::test_install_execution 3 1.6s 4.7s
imix::bin/imix: tests::task_tests::test_task_eprint_behavior 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_eprint_behavior 3 3.0s 3.0s
imix::bin/imix: tests::task_tests::test_task_eprint_behavior 3 3.0s 3.0s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

google-labs-jules bot and others added 2 commits March 7, 2026 03:18
- Modify `get_reg` in `eldritch-libsys` to take a single `path` parameter instead of separate `hive` and `path`.
- Introduce `parse_registry_path` to split the combined path into a hive and subkey.
- Support shortened hive aliases like `HKLM`, `HKCU`, etc. alongside the expanded versions.
- Consolidate `write_reg_hex`, `write_reg_int`, and `write_reg_str` into a single `write_reg` function.
- `write_reg` accepts an `eldritch_core::Value` parameter and performs type checking depending on the provided registry type string (e.g. `REG_DWORD`, `REG_SZ`, `REG_BINARY`).
- Update `std` and `fake` implementations, as well as associated test files.
- Update `get_registry` and `enable_rdp` tomes (`main.eldritch` and `metadata.yml`) to use the new single path argument and `sys.write_reg`.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Replaced `write_reg_str`, `write_reg_int`, and `write_reg_hex` with a single `write_reg` function.
- The new `write_reg` function accepts any `eldritch_core::Value` type and dynamically validates it against the specified registry type (e.g., matching a string to `REG_SZ`, int or parsed string to `REG_DWORD`).
- Unified the path parameter for registry writes to match the newly updated `get_reg` single-path parameter.
- Updated `fake.rs`, `std.rs`, and mock libraries to reflect the method signature change.
- Re-wrote and migrated unit tests from the removed individual implementations to the unified `write_reg_impl.rs` file.
- Updated `bindings_test.rs` to assert the new bindings signature.
- Removed unused imports and cleaned up formatting.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto hulto marked this pull request as ready for review March 7, 2026 04:05
google-labs-jules bot and others added 4 commits March 7, 2026 15:17
- Modify `parse_registry_path` to convert `\\` to `\` before splitting the path.
- Add tests to ensure both single, double and mixed backslashes are supported in `parse_registry_path`.
- Fix build and fmt issues.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Modify `parse_registry_path` to normalize `\\` to `\` before splitting the path to extract the hive.
- Add tests in `reg_utils.rs` to verify correct behavior with single, double, and mixed backslash usage.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Ran `cargo fmt` to fix formatting issues in `implants/lib/eldritch/stdlib/eldritch-libsys/src/std/reg_utils.rs` and `implants/lib/eldritch/stdlib/eldritch-libsys/src/std/write_reg_impl.rs` which were causing the implants CI check runs to fail.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Update `sys.write_reg` and `sys.get_reg` documentation in `eldritch.md` to reflect the new single-path and consolidated value-agnostic variations.
- Run `generate-docs.js` to update `eldritch-docs.json`.
- Restored inadvertently deleted `d.ts` typescript interfaces inside `tavern/internal/www`.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto hulto marked this pull request as draft March 8, 2026 03:58
hulto and others added 8 commits March 7, 2026 23:10
- Removed outdated documentation for `sys.write_reg_hex`, `sys.write_reg_int`, and `sys.write_reg_str` from `docs/_docs/user-guide/eldritch.md`.
- Added updated documentation for `sys.write_reg` with examples mapping to the new signature in `docs/_docs/user-guide/eldritch.md`.
- Re-generated `tavern/internal/www/src/assets/eldritch-docs.json` by running `generate-docs.js`.
- Cleaned up output log file and checked frontend UI build integrity.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Updated `tavern/internal/portals/integration_test.go` to generate dynamic random identifiers (appending `time.Now().UnixNano()`) instead of hardcoded strings for Users, Hosts, and Beacons.
- This resolves intermittent `UNIQUE constraint failed` test failures during `go test`.
- Removed accidental `.patch`, `.orig`, `.rej`, and `output.log` files that were erroneously staged during investigation.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto hulto marked this pull request as ready for review March 14, 2026 13:59
hulto and others added 2 commits March 14, 2026 10:00
- Removed unused `ToString` import in `implants/lib/eldritch/stdlib/eldritch-libsys/src/std/write_reg_impl.rs` that was causing `cargo fmt --check` to fail.
- Removed unused imports in `reg_utils.rs`.
- Fixed the `time` library `sleep` interface change (`f64` instead of `i64`).

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto
Copy link
Collaborator Author

hulto commented Mar 14, 2026

Regen the wasm auto-complete docs

hulto and others added 4 commits March 14, 2026 14:38
- In `implants/lib/eldritch/stdlib/eldritch-libreport/src/std/process_list_impl.rs`, replaced the undefined `status` variable reference with a hardcoded `0` since status parsing was deliberately disabled due to missing string-to-enum mapping logic.
- Cleaned up an unused `alloc::format` import in `implants/lib/eldritch/stdlib/eldritch-libfile/src/std/list_impl.rs`.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto
Copy link
Collaborator Author

hulto commented Mar 14, 2026

SLOP 😭

@hulto hulto closed this Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant