From 50b7e0f1b1ef496d594cf2a8dd4f78c77c57764d Mon Sep 17 00:00:00 2001 From: ldby Date: Wed, 18 Mar 2026 23:59:06 +0100 Subject: [PATCH 1/4] fix wua_history typeError --- dissect/target/plugins/os/windows/wua_history.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dissect/target/plugins/os/windows/wua_history.py b/dissect/target/plugins/os/windows/wua_history.py index 9b869f65a6..7d90c75bf1 100644 --- a/dissect/target/plugins/os/windows/wua_history.py +++ b/dissect/target/plugins/os/windows/wua_history.py @@ -1063,9 +1063,11 @@ def _format_record_value(self, mapped_column_name: str, value: str) -> dict[str, format_data[mapped_column_name] = value format_data["classification_mapped"] = CLASSIFICATION_MAP.get(value, "Unknown") elif mapped_column_name == "title": + if isinstance(value, bytes): + value = value.decode(errors="ignore") format_data[mapped_column_name] = value - if kb := re.search(r"(KB.[0-9]*)", value): - format_data["kb"] = kb.group() + if kb := re.search(r"(KB\d+)", value): + format_data["kb"] = kb.group(1) elif mapped_column_name == "status_id": format_data[mapped_column_name] = value format_data["status_mapped"] = STATUS_MAP.get(value, "Unknown") @@ -1077,3 +1079,4 @@ def _format_record_value(self, mapped_column_name: str, value: str) -> dict[str, format_data[mapped_column_name] = value return format_data + From 151bd78ae60dbc93a5eab306d6eb64d15586d072 Mon Sep 17 00:00:00 2001 From: ldby Date: Thu, 19 Mar 2026 08:46:37 +0100 Subject: [PATCH 2/4] reinstate old regex --- dissect/target/plugins/os/windows/wua_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dissect/target/plugins/os/windows/wua_history.py b/dissect/target/plugins/os/windows/wua_history.py index 7d90c75bf1..a84bd74fd7 100644 --- a/dissect/target/plugins/os/windows/wua_history.py +++ b/dissect/target/plugins/os/windows/wua_history.py @@ -1066,7 +1066,7 @@ def _format_record_value(self, mapped_column_name: str, value: str) -> dict[str, if isinstance(value, bytes): value = value.decode(errors="ignore") format_data[mapped_column_name] = value - if kb := re.search(r"(KB\d+)", value): + if kb := re.search(r"(KB.[0-9]*)", value): format_data["kb"] = kb.group(1) elif mapped_column_name == "status_id": format_data[mapped_column_name] = value From 12bcd5d035c8d8e543e147a9398be75040521253 Mon Sep 17 00:00:00 2001 From: ladyboy Date: Thu, 19 Mar 2026 22:18:05 +0200 Subject: [PATCH 3/4] Update wua_history.py Co-authored-by: Luke Paris --- dissect/target/plugins/os/windows/wua_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dissect/target/plugins/os/windows/wua_history.py b/dissect/target/plugins/os/windows/wua_history.py index a84bd74fd7..5a75607583 100644 --- a/dissect/target/plugins/os/windows/wua_history.py +++ b/dissect/target/plugins/os/windows/wua_history.py @@ -1063,7 +1063,7 @@ def _format_record_value(self, mapped_column_name: str, value: str) -> dict[str, format_data[mapped_column_name] = value format_data["classification_mapped"] = CLASSIFICATION_MAP.get(value, "Unknown") elif mapped_column_name == "title": - if isinstance(value, bytes): + if isinstance(value,(bytes, bytearray)): value = value.decode(errors="ignore") format_data[mapped_column_name] = value if kb := re.search(r"(KB.[0-9]*)", value): From 0c0bf5af76c5fdf113f319143b1022e7b3b5cb23 Mon Sep 17 00:00:00 2001 From: ladyboy Date: Thu, 19 Mar 2026 22:18:11 +0200 Subject: [PATCH 4/4] Update wua_history.py Co-authored-by: Luke Paris --- dissect/target/plugins/os/windows/wua_history.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dissect/target/plugins/os/windows/wua_history.py b/dissect/target/plugins/os/windows/wua_history.py index 5a75607583..8d2f320901 100644 --- a/dissect/target/plugins/os/windows/wua_history.py +++ b/dissect/target/plugins/os/windows/wua_history.py @@ -1064,7 +1064,7 @@ def _format_record_value(self, mapped_column_name: str, value: str) -> dict[str, format_data["classification_mapped"] = CLASSIFICATION_MAP.get(value, "Unknown") elif mapped_column_name == "title": if isinstance(value,(bytes, bytearray)): - value = value.decode(errors="ignore") + value = bytes(value).decode(errors="ignore") format_data[mapped_column_name] = value if kb := re.search(r"(KB.[0-9]*)", value): format_data["kb"] = kb.group(1)