From facf4c5af386027109b95c9f771ee04bc74a4b49 Mon Sep 17 00:00:00 2001 From: carelesmind <54251069+carelesmind@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:19:03 -0500 Subject: [PATCH] Update parse-uboot-dump.py - Added sanitization for weird chars (mostly null) that randomly came across my serial output. - Changed len requirements to anything more than 1. My output consistently had hex 3a, which was rendered in the md output as `:`, which would then skip the entire line because len would be more than 2. Output was always smaller than I would expect and caused binwalk to eat dirt. --- parse-uboot-dump.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parse-uboot-dump.py b/parse-uboot-dump.py index c67ec7f..c1212b3 100755 --- a/parse-uboot-dump.py +++ b/parse-uboot-dump.py @@ -10,9 +10,10 @@ for line in i.readlines(): line = line.strip() + line = ''.join(char for char in line if ord(char) < 128 and ord(char) != 0) if re.match(r'^[0-9a-f]{8}:',line): line = line.split(":") - if len(line) == 2: + if len(line) > 1: line = line[1] line = line.replace(" ","")[:32] data = bytes.fromhex(line)