Hi everyone!
After some research done around the possible ways to read registry hives without using the internal windows API, now comes to time to actually write back the loaded hive onto disk.
Googling for documentation brought no usable results since this truly seems a *very* undocumented area. I actually tought it would be more difficult to read and understand a registry hive, but now I come to the conclusion that is more challenging to understand what takes for a registry to be considered as valid under the eyes of regedit or reg.exe.
Since this community counts with members whose expertise on this area is quite formidable, I hope that somehow we can fill this gap and properly document everything that is needed to handle registry hives for generations to count with this small step..

For current documentation, you can find several program source-codes showing how to read the registry hives. I personally didn't found any one that I liked to use under delphi - there was a raw offline reader, but the code wasn't very clear so I started one from scratch to also learn more about the registry design.
As tools to for this task I recommend using a good hex editor - I've used
Tiny Hexer since it allows to open several copies of the same binary file and it's completely free (and easy to use)
You should use your favourite programming language to create your own registry read method, what we need here is to discover wich nuances are involved in the creation of a registry hive.
For documentation look here:
http://www.beginningtoseethelight.org/ntsecurity/ --> Complete map to the registry structure
http://download.sysinternals.com/Files/Win...ls-Chapter4.pdf --> Explaining the registry organization
Also a mirror here:
http://rjohnson.uninformed.org/ref/SAM.htmI've also created a few images explaining some of the steps for reading (mostly done for writing) the registry keys, they'll probably make more sense after reading the above mentioned links.
I've done a small application for testing hives, available on our previous discussion topic here:
http://www.boot-land.net/forums/Running-re...ives-t1703.htmlCheck the resource links posted by Jaclaz and the last topics to get the binaries produced so far..
I will be posting my advances and knowledge regarding what can and not be done inside the registry hive to make it a valid file while I do my testings, but it would really help if more people could also join in and try to bring a working solution for this challenge.
Good luck and I hope this helps more people to see how this gets done!