-
Notifications
You must be signed in to change notification settings - Fork 1
Python development
libcreg comes with Python-bindings named pycreg.
Below are examples how use pycreg. They assume you have a working version of pycreg on your system. To build pycreg see Building.
To be able to use pycreg in your Python scripts add the following import:
import pycreg
The get_version() module function can be used to retrieve the version of the pycreg.
pycreg.get_version()
This will return a textual string (Unicode) that contains the libcreg version. Since pycreg is a wrapper around libcreg it does not have a separate version.
creg_file = pycreg.file()
creg_file.open("NTUSER.DAT")
...
creg_file.close()
The explicit call to creg_file.close() is not required. Close only must be called once all operations on the file have been completed.
file_object = open("NTUSER.DAT", "rb")
creg_file = pycreg.file()
creg_file.open_file_object(file_object)
...
creg_file.close()
The explicit call to creg_file.close() is not required. Close only must be called once all operations on the file have been completed and will not close the file-like object itself.
import pycreg
help(pycreg)
help(pycreg.file)