First off, you do great work, with this and rawcopy. But I ran into an issue
attached is empty registry .dat with one key that I can not access.
It looks like a key with null char was created and then strip of permissions
I ran your tool and it is getting this
Invalid keyname in hex: 010000000100
Number of invalid charaters in keyname: 3
Error in NtOpenKey 3 : 0xC0000022 -> Access is denied.
So reviewing what you wrote, you are trying to open a handle to the invalid keyname, but since there is no permissions on the key, it is failing,
I look at adjusting the permissions using Fred (FredAI)'s permission UDF, but he needs stringname or handle to adjust the permissions. so the keyname is invalid and cannot get a handle on the key..
So any ideas?