diff --git a/regipy/__init__.py b/regipy/__init__.py index 5759416..e67b520 100644 --- a/regipy/__init__.py +++ b/regipy/__init__.py @@ -1,3 +1,3 @@ from .registry import * __title__ = 'regipy' -__version__ = '4.2.1' +__version__ = '4.3.0' diff --git a/regipy/plugins/ntuser/shellbags_ntuser.py b/regipy/plugins/ntuser/shellbags_ntuser.py index 7e4e9a6..42101dc 100644 --- a/regipy/plugins/ntuser/shellbags_ntuser.py +++ b/regipy/plugins/ntuser/shellbags_ntuser.py @@ -9,7 +9,7 @@ logger = logging.getLogger(__name__) NTUSER_SHELLBAG = '\\Software\\Microsoft\\Windows\\Shell\\BagMRU' -CODEPAGE = 'cp1252' +DEFAULT_CODEPAGE = 'cp1252' class ShellBagNtuserPlugin(Plugin): @@ -198,7 +198,7 @@ def _parse_shell_item_path_segment(self, shell_item): return path_segment, full_path, location_description - def iter_sk(self, key, reg_path, base_path='', path=''): + def iter_sk(self, key, reg_path, codepage=DEFAULT_CODEPAGE, base_path='', path=''): try: import pyfwsi except ModuleNotFoundError as ex: @@ -223,7 +223,7 @@ def iter_sk(self, key, reg_path, base_path='', path=''): slot = v.name byte_stream = v.value shell_items = pyfwsi.item_list() - shell_items.copy_from_byte_stream(byte_stream, ascii_codepage=CODEPAGE) + shell_items.copy_from_byte_stream(byte_stream, ascii_codepage=codepage) for item in shell_items.items: shell_type = self._get_shell_item_type(item) value, full_path, location_description = self._parse_shell_item_path_segment(self, item) @@ -283,10 +283,10 @@ def iter_sk(self, key, reg_path, base_path='', path=''): self.entries.append(entry) sk_reg_path = f'{reg_path}\\{value_name}' sk = self.registry_hive.get_key(sk_reg_path) - self.iter_sk(sk, sk_reg_path, base_path, path) + self.iter_sk(sk, sk_reg_path, codepage, base_path, path) path = base_path - def run(self): + def run(self, codepage=DEFAULT_CODEPAGE): try: import pyfwsi @@ -298,6 +298,6 @@ def run(self): try: shellbag_ntuser_subkey = self.registry_hive.get_key(NTUSER_SHELLBAG) - self.iter_sk(shellbag_ntuser_subkey, NTUSER_SHELLBAG) + self.iter_sk(shellbag_ntuser_subkey, NTUSER_SHELLBAG, codepage=codepage) except RegistryKeyNotFoundException as ex: logger.error(f'Could not find {self.NAME} plugin data at: {NTUSER_SHELLBAG}: {ex}') \ No newline at end of file diff --git a/regipy/plugins/usrclass/shellbags_usrclass.py b/regipy/plugins/usrclass/shellbags_usrclass.py index 1c59595..fb0134f 100644 --- a/regipy/plugins/usrclass/shellbags_usrclass.py +++ b/regipy/plugins/usrclass/shellbags_usrclass.py @@ -9,7 +9,7 @@ logger = logging.getLogger(__name__) USRCLASS_SHELLBAG = '\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU' -CODEPAGE = 'cp1252' +DEFAULT_CODEPAGE = 'cp1252' class ShellBagUsrclassPlugin(Plugin): @@ -202,7 +202,7 @@ def _parse_shell_item_path_segment(self, shell_item): return path_segment, full_path, location_description - def iter_sk(self, key, reg_path, base_path='', path=''): + def iter_sk(self, key, reg_path, codepage=DEFAULT_CODEPAGE, base_path='', path=''): try: import pyfwsi except ModuleNotFoundError as ex: @@ -227,7 +227,7 @@ def iter_sk(self, key, reg_path, base_path='', path=''): slot = v.name byte_stream = v.value shell_items = pyfwsi.item_list() - shell_items.copy_from_byte_stream(byte_stream, ascii_codepage=CODEPAGE) + shell_items.copy_from_byte_stream(byte_stream, ascii_codepage=codepage) for item in shell_items.items: shell_type = self._get_shell_item_type(item) value, full_path, location_description = self._parse_shell_item_path_segment(self, item) @@ -287,10 +287,10 @@ def iter_sk(self, key, reg_path, base_path='', path=''): self.entries.append(entry) sk_reg_path = f'{reg_path}\\{value_name}' sk = self.registry_hive.get_key(sk_reg_path) - self.iter_sk(sk, sk_reg_path, base_path, path) + self.iter_sk(sk, sk_reg_path, codepage, base_path, path) path = base_path - def run(self): + def run(self, codepage=DEFAULT_CODEPAGE): try: import pyfwsi @@ -302,6 +302,6 @@ def run(self): try: shellbag_usrclass_subkey = self.registry_hive.get_key(USRCLASS_SHELLBAG) - self.iter_sk(shellbag_usrclass_subkey, USRCLASS_SHELLBAG) + self.iter_sk(shellbag_usrclass_subkey, USRCLASS_SHELLBAG, codepage=codepage) except RegistryKeyNotFoundException as ex: logger.error(f'Could not find {self.NAME} plugin data at: {USRCLASS_SHELLBAG}: {ex}') \ No newline at end of file