Rejistry updates#37
Conversation
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>
|
This PR is to take in changes from sleuthkit#3447 and address comments and fix other memory leaks. |
|
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. |
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.
|
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. |
|
After this PR is merged we should close out sleuthkit#3447 and push this to the public repo |
No description provided.