Skip to content

Commit a9d9d9a

Browse files
committed
process xor recognizes 1-byte case
1 parent 47faa45 commit a9d9d9a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kaitaistruct.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ def process_xor_one(data, key):
348348
def process_xor_many(data, key):
349349
if key == b'\x00' * len(key):
350350
return data
351+
if len(key) == 1:
352+
return KaitaiStream.process_xor_one(data, ord(key))
351353

352354
if PY2:
353355
return bytes(bytearray(a ^ b for a, b in zip(bytearray(data), itertools.cycle(bytearray(key)))))

0 commit comments

Comments
 (0)