Skip to content

Commit 397be71

Browse files
author
Willi Ballenthin
committed
nodes: binary is bytes, not str
1 parent 3714c62 commit 397be71

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Evtx/Nodes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def fast_substitutions(self):
10141014
elif type_ == 0x14:
10151015
value = "0x"
10161016
for c in self.unpack_binary(ofs, size)[::-1]:
1017-
value += "{:02x}".format(ord(c))
1017+
value += "{:02x}".format(c)
10181018
sub_def.append(value)
10191019
#[21] = parse_hex64_type_node, -- Hex64TypeNode, 0x15
10201020
elif type_ == 0x15:
@@ -1031,7 +1031,7 @@ def fast_substitutions(self):
10311031
bin = self.unpack_binary(ofs, size)
10321032
acc = []
10331033
while len(bin) > 0:
1034-
match = re.search("((?:[^\x00].)+)", bin)
1034+
match = re.search(b"((?:[^\x00].)+)", bin)
10351035
if match:
10361036
frag = match.group()
10371037
acc.append("<string>")
@@ -1040,7 +1040,7 @@ def fast_substitutions(self):
10401040
bin = bin[len(frag) + 2:]
10411041
if len(bin) == 0:
10421042
break
1043-
frag = re.search("(\x00*)", bin).group()
1043+
frag = re.search(b"(\x00*)", bin).group()
10441044
if len(frag) % 2 == 0:
10451045
for _ in range(len(frag) // 2):
10461046
acc.append("<string></string>\n")

0 commit comments

Comments
 (0)