Jolanta Thomassen's thesis Peter Norris' masters thesis
In my journey to learn a bit more about computer science, it might be nice to learn how to play with the registry
The registry is a big dictionary
The registry contains
The registry files are in Windows/system32/config The database files are
called hives
Info specific to certain users are in NTUSER.dat and the USRCLASS.dat hives
Hives are made up of 4-KB sections called bins
the first 4 bytes start with regf
every 4096 bytes there is hbin
data sits neatly inside of the bins; it doesn't split between adjacent bins
when new bins are required, space will be taken from unallocated memory, so you can see old registry data inside of other registry files sometimes
You can actually look at this unallocated space using data carving tools
Hbins are in turn made up of different sections, called cells
Interestingly, the size of a key is negative If the key is deleted, then its size is made positive
Unlike keys, value cells don't contain pointers to other cells
On 64-bit Windows, some registry calls by 32-bit apps are redirected to a different hive
HKEY_LOCAL_MACHINE/Software/Wow6432Node key,
rather than just …/SoftwareRegistry modifications that have a global aspect on the system will be written to a virtual store
HKEY_USERS/<SID>_Classes/VirtualStore/Machine/Software/keypathThe Registry's purpose is to replace the config and init files that Windows 3.1 used
There is no full listing of what actions by a user or the OS impact which Registry keys, and how they do so
The Registry acts as a log file
One of the reasons that the Registry gets used in malware is that the Registry has persistence across reboots and logins
ex. It lets the system remember that you've plugged in a certain device before
ex. It remembers your settings for apps, if you don't use the defaults
ex. It remembers recently accessed files
Note: not all apps create a presence in the registry
The binary structure of the registry has been more-or-less unchanged across different versions of Windows
The GUI
Parts of the registry visible in the editor are volatile
HKEY_CURRENT_USER hive — you
can see it in the editor, but if you shut down the system and look at an
acquired image, you won't find that hiveIn the local machine system hive, there's a key called CurrentControlSet
HKEY_CLASSES_ROOT
An OS's ability to hold onto file system metadata
These are 32-bit binary values
Settings for the person currently logged in
To get rid of internet suggestions when you search something in explorer
If the Serialize folder/key doesn't
already exist, create it, and add two dwords
For some reason Windows delays the startup of certain apps; in particular, when I put apps in the startup folder, it delays them (like emacs and Neptune)
This is a really cool part of the registry — you can use it to edit the right-click menu that appears when you right click a file or blank space in Windows Explorer
It controls
There are a bunch of keys in here that are all a dot followed by an
extension: ex: .txt
If this appears in a .extension key, it will cause right clicking a blank space in Explorer and going to "new" on the menu, to give "create a new .extension file" as an option
(Default)FileName: a string
value which acts as a template for the new file — whatever the
string value is a path to the template file
C:\Windows\ShellNewThis is the subkey for what happens when you right click on a particular file type
.txt/shell determines what happens
when you right-click on a text fileThe asterisk is a wildcard, and corresponds to every file type
This controls what happens when you right-click a folder
This subkey controls what happens when you click on the blank space in a folder