I am looking for a Python API (or a C API as I am willing to bind) for editing Windows registries from XP to 7 from within a Linux system.
The Windows target will be
You may want to have a look at this project. The initial idea was to recover passwords but all the tools are there to edit registry entries.
It sounds like a dangerous idea though, I would rather find a way to launch a Python script - even remotely - with _winreg
in its own environment but it doesn't seem to be a possibility for you. Note also that I didn't see any mention of Windows 7 in their project.
OK, so you're after a hive file editor?
I wrote a winregistry
module that does this (for both NT and win9x hives). It's not really ready for the public but worked quite well with the data I was using at the time. I'm not sure what state I left it in and I haven't tested it with Win7 hives, but maybe we could get it fixed up for release? If you're interested I could probably dump it in a source control somewhere to work on.
The document I worked from was ntpasswd's well-known WinReg.txt, however I found many flaws in it (can also chuck you my annotations on that). Since then these documents have been produced, which at first glance may cover matters better.
I think you are out of luck, as I couldn't find any such lib. when I need such thing some years back(to change a windows image file). Also writing it yourself isn't easy and I also couldn't find any MS document describing the format.
here are some links which come up in google search and describe format partially http://www.sentinelchicken.com/research/registry_format/ http://home.eunet.no/pnordahl/ntpasswd/WinReg.txt
Creddump is written in Python (no C extensions) and has code to read the registry (though not write it). It may help you get started:
http://code.google.com/p/creddump/