Skip to content

Rejistry updates#37

Merged
jayaramcs merged 10 commits intoSleuthKitLabs:develop-4.14from
crayy8:rejistry_updates
Mar 23, 2026
Merged

Rejistry updates#37
jayaramcs merged 10 commits intoSleuthKitLabs:develop-4.14from
crayy8:rejistry_updates

Conversation

@crayy8
Copy link
Member

@crayy8 crayy8 commented Mar 15, 2026

No description provided.

bcarrier and others added 7 commits March 2, 2026 10:54
Replace raw pointer typedefs with std::unique_ptr for SubkeyListRecord,
ValueListRecord, DBRecord, and DBIndirectRecord. All Cell factory methods
now use make_unique. Callers no longer manually delete these returned
records. Also fixes a logic bug in NKRecord::getSubkeyList() where the
early-return for empty subkey count was missing the return keyword,
causing fall-through to an invalid offset read. Initialize previously
uninitialized member variables in BinaryBlock, Buffer, and
DirectSubkeyListRecord. Remove orphaned LIRecordPtr typedef from LIRecord.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c->getSubkeyList() returns unique_ptr by value (already an rvalue),
so std::move is a no-op. Also remove now-unused <utility> include.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clarify which methods return unique_ptr (no caller cleanup needed)
vs raw pointers where the caller is responsible for freeing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consistent with prior member initialization fixes across the library.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@crayy8
Copy link
Member Author

crayy8 commented Mar 16, 2026

This PR is to take in changes from sleuthkit#3447 and address comments and fix other memory leaks.

@crayy8
Copy link
Member Author

crayy8 commented Mar 16, 2026

I am generally good with this PR but we should have Ann review and I'd like to do some comparisons on registry output before and after before we merge this.

@crayy8 crayy8 closed this Mar 16, 2026
@crayy8 crayy8 reopened this Mar 16, 2026
@crayy8 crayy8 requested a review from APriestman March 16, 2026 02:27
crayy8 and others added 2 commits March 18, 2026 00:02
Forensic data may not be properly null-terminated. After parsing
null-delimited strings, capture any trailing data that lacks a
double-null terminator by padding for wchar_t alignment and
appending a null terminator before constructing the wstring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The offset parameter now correctly refers to the destination buffer
offset rather than the source buffer offset, matching the original
Java ByteBuffer.get(byte[], int, int) contract. Fixed validation
checks and memcpy accordingly.
Wrap printVKRecord and printNKRecord in try/catch so a single malformed
record does not abort enumeration. Add hive synchronization status
output to processRegistryFile. Improve exception messages with function
context prefixes.
@crayy8
Copy link
Member Author

crayy8 commented Mar 19, 2026

This looks good to me now.

For testing I used the registry hive samples from Registry Explorer. I then ran our test exe rejistry.exe that is built as part of our project that enumerates all of the key data we parse. I diffed the data from 4.14 version and this new version. The only differences were due to a fix that was made in this PR.

@APriestman if you can give this a quick review when you have time.

@crayy8
Copy link
Member Author

crayy8 commented Mar 19, 2026

After this PR is merged we should close out sleuthkit#3447 and push this to the public repo

@jayaramcs jayaramcs merged commit 91d4be6 into SleuthKitLabs:develop-4.14 Mar 23, 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.

4 participants