mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-06 23:05:06 +01:00
fix to_bytes() mandatory byte_order
This commit is contained in:
parent
672d18a5ca
commit
158564e79a
1 changed files with 1 additions and 1 deletions
2
utils.py
2
utils.py
|
|
@ -114,7 +114,7 @@ def replace_escaped_octal_utf8_bytes_with_str(str):
|
|||
for encoded_name_string in encoded_name_strings:
|
||||
escaped_bytes = re.findall(r'((?:\\[0-9]+)+)', encoded_name_string)
|
||||
for byte_sequence in escaped_bytes:
|
||||
unicode_str = b''.join([int(byte, 8).to_bytes(1) for byte in byte_sequence.split('\\') if byte]).decode('utf-8')
|
||||
unicode_str = b''.join([int(byte, 8).to_bytes(1, 'little') for byte in byte_sequence.split('\\') if byte]).decode('utf-8')
|
||||
print("Replace '{}' by '{}'".format(byte_sequence, unicode_str))
|
||||
str = str.replace(byte_sequence, unicode_str)
|
||||
return str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue