diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-10 15:00:04 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-10 15:37:08 +0200 |
commit | f31e55fea4fd5fca7598f9e20caed50ae04796e5 (patch) | |
tree | d83a7bb7e8d060c5f5289b07cf3a7c6e18510783 | |
parent | 084650e4b1650386d55a2c14f17c745c3fcb913f (diff) |
bcd: make recovery modifications optionalv1.3.2-19
Ignore recovery disable if no Recovery node is found in the BCD.
-rw-r--r-- | src/utils/bcd.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils/bcd.py b/src/utils/bcd.py index dc85cc3..c2a13a0 100644 --- a/src/utils/bcd.py +++ b/src/utils/bcd.py @@ -85,7 +85,11 @@ def _match_node_with_type_data(hive, entry_node): def disable_recovery_field(hive, entry_node): - recovery_node = get_node_child_from_path(hive, entry_node, f'Elements/{BCDEntryElement.RECOVERY_ENABLED.value}') + try: + recovery_node = get_node_child_from_path(hive, entry_node, f'Elements/{BCDEntryElement.RECOVERY_ENABLED.value}') + except: + logging.info("no Recovery entry is found, skipping") + return recovery_value = {'key': 'Element', 't': RegistryType.BINARY.value, 'value': b'\x00'} hive.node_set_value(recovery_node, recovery_value) |