aiowinreg
aiowinreg copied to clipboard
AIOWinRegHive() class should probably support bytes object as input?
Just a small heads up on a possible issue:
If you have a hive as a bytes object and use AIOWinRegHive class something like this:
sw = AIOWinRegHive(software_hive_bytes)
for x in sw.enum_key('some path'):
do_stuff()
Then you will get a traceback like this: File "aiowinreg/hive.py", line 88, in enum_key self.setup() File "aiowinreg/hive.py", line 26, in setup self.header = NTRegistryHeadr.read(self.reader) File "aiowinreg/filestruct/header.py", line 61, in read hdr.parse_header_buffer(reader) File aiowinreg/filestruct/header.py", line 38, in parse_header_buffer self.magic = reader.read(4) AttributeError: 'bytes' object has no attribute 'read'
This problem can be avoided by passing the bytes object as an io.BytesIO() instead, but I guess this would be better to handle internally by the class?
I have not created a pull request for this issue as I was not totally sure how it should best be done to match the rest of the project.