Named Key cells are the data structures within the Registry that hold the Keys and provide the parent/child data necessary to build the tree. Different documentation calls these Named Keys, Node Keys, or NT Keys. It is unclear which is correct, so I’m going to go with Noodle Keys.
|offset||length||type||what is it?|
|x08||8||datetime||Last Modified Date|
|x14||4||int32||Parent Key Offset|
|x18||4||int32||Number of stable sub keys|
|x1C||4||int32||Number of volatile sub keys|
|x20||4||int32||Sub key offset|
|x24||4||int32||Volatile sub key offset|
|x28||4||int32||Value List Count|
|x2C||4||int32||Value List Offset|
|x30||4||int32||Security key offset|
|x34||4||int32||Class name offset|
|x38||4||int32||Max name length|
|x3C||4||int32||Max class name size|
|x40||4||int32||Max value name size|
|x44||4||int32||Max value data size|
|x4C||2||int16||Key name size (n)|
|x4E||2||int16||Class name size|
This is what one would look like in a hex editor:
|Length||Sig||Flags||Last Modified Date|
|Unknown||Parent||# Skey subs||# Vkey sub|
|Skey offset||Vkey offset||VL count||VL offset|
|Seckey offset||Class offset||Max Name Len||Max Cls Sz|
|Max Name Sz||Max Data Sz||Unknown||KNS||CNS|
Notes and observations:
The length field at the beginning is a negative number for allocated cells. So, an 88 byte cell has a length of xA8FFFFFF and a really long cell of 264 bytes would be xF8FEFFFF. When this number is positive it describes an unallocated cell. When searching for unallocated cells, I’ve seen three scenarios: 1. the cell is empty (length makes no sense), 2. the cell is partially overwritten (size is logical, but another record is found much sooner), and 3. the cell is a whole deleted record (yea!).
Scenario 1 looks like this. Note the length set to x00 and the complete lack of usefulness. This appears to be the case when an unallocated cell’s ‘nk’ signature appears in slack space of another cell. In this example below, the x0000 at offset x00 is the null terminator to the string on the previous line and that cell consumes all the way to offset x07 with the next cell starting at offset x08.
Scenario 2 looks like this. This appears to be legit data that was partially overwritten. We have a length field of x58 or 88 bytes, yet we have another cell starting after 64 bytes.
|00||58||00||00||00||6E||6B||20||00||68||51||82||45||30||89||CB||01||X nk hQ‚E0‰Ë|
|40||A8||FF||FF||FF||6E||6B||20||00||37||7A||B2||76||18||3E||D0||01||¨ÿÿÿnk 7z²v >Ð|
The flags at offset x6 tell us some interesting things about this key. They parse out as:
|00000010||x02||Is mount point|
|00001000||x08||Cannot be deleted|
|00010000||x10||Is symbolic link|
|00100000||x20||Name is ASCII, 0 = Unicode|
|01000000||x40||Is predefined handle|
Most of these fields seem self explanatory based on the names, but I’ve seen conflicting names in different documentation.
Several of the fields will be xffffffff if they are undefined, such as Volatile Sub Key Offset and other offsets.
Parent Key Offset at offset x14 provides the location of the cell that is this cell’s parent. Offset starts from start of first bin, so add 4096 to cover regf header. Root cell has a value in this field even though it doesn’t have a parent and that value is garbage that points to a location that doesn’t make any sense. Not sure why that isn’t just zeroed out.
Sub Key Offset will point to an lf cell that lists all of the children cells and provides their locations. The best and most succinct explanation of this relationship is in appendix 22 of Norris’s documentation. More on that later.
The Value Key Offset and Count work just like the Sub Key data but for Values.