Skip to content

Commit cd432ae

Browse files
authored
Changes for missing separator in HKEY_USERS paths #180 (#188)
1 parent b86ecb7 commit cd432ae

File tree

3 files changed

+245
-186
lines changed

3 files changed

+245
-186
lines changed

dfwinreg/registry.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,19 +397,21 @@ def _GetUsersVirtualKey(self, key_path_suffix):
397397

398398
# HKEY_USERS\%SID%_CLASSES maps to UsrClass.dat
399399
if user_key_name.endswith('_CLASSES'):
400-
profile_path = '\\'.join([
400+
profile_path = definitions.KEY_PATH_SEPARATOR.join([
401401
profile_path, 'AppData', 'Local', 'Microsoft', 'Windows',
402402
'UsrClass.dat'])
403403
else:
404-
profile_path = '\\'.join([profile_path, 'NTUSER.DAT'])
404+
profile_path = definitions.KEY_PATH_SEPARATOR.join([
405+
profile_path, 'NTUSER.DAT'])
405406

406407
registry_file = self._GetUserFileByPath(profile_path)
407408
if not registry_file:
408409
break
409410

410411
key_path_prefix = definitions.KEY_PATH_SEPARATOR.join([
411412
'HKEY_USERS', user_key_name])
412-
key_path = ''.join([key_path_prefix, key_path_suffix])
413+
key_path = definitions.KEY_PATH_SEPARATOR.join([
414+
key_path_prefix, key_path_suffix])
413415

414416
registry_file.SetKeyPathPrefix(key_path_prefix)
415417
return registry_file.GetKeyByPath(key_path)

0 commit comments

Comments
 (0)