summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-10 15:00:04 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-10 15:37:08 +0200
commitf31e55fea4fd5fca7598f9e20caed50ae04796e5 (patch)
treed83a7bb7e8d060c5f5289b07cf3a7c6e18510783 /src
parent084650e4b1650386d55a2c14f17c745c3fcb913f (diff)
bcd: make recovery modifications optionalv1.3.2-19
Ignore recovery disable if no Recovery node is found in the BCD.
Diffstat (limited to 'src')
-rw-r--r--src/utils/bcd.py6
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)