Skip to content

Commit be60bc5

Browse files
committed
Python tools: Add missing newlines to sys.stderr.write
1 parent 66c7b03 commit be60bc5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

run/encfs2john.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def process_folder(folder):
5858
if not cipher or not keySize or not iterations or not salt or \
5959
not saltLen or not dataLen or not data:
6060
sys.stderr.write("%s contains bad data, please report this " \
61-
"if target contains valid EncFS data" % filename)
61+
"if target contains valid EncFS data\n" % filename)
6262
return
6363

6464
if cipher.upper().find("AES") > -1:

run/fvde2john.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
try:
1717
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
1818
except ImportError:
19-
sys.stderr.write("cryptography is missing, run 'pip install --user cryptography' to install it!")
19+
sys.stderr.write("cryptography is missing, run 'pip install --user cryptography' to install it!\n")
2020
sys.exit(1)
2121
try:
2222
import pytsk3
2323
except ImportError:
24-
sys.stderr.write("pytsk3 is missing, run 'pip install --user pytsk3' to install it!")
24+
sys.stderr.write("pytsk3 is missing, run 'pip install --user pytsk3' to install it!\n")
2525
sys.exit(1)
2626

2727
HEX_CORE_STORAGE_TYPE_GUID = '53746F72-6167-11AA-AA11-00306543ECAC'
@@ -50,7 +50,7 @@ def guid_to_hex(guid):
5050
def try_read_fp(fp, bytes_to_read):
5151
out = fp.read(bytes_to_read)
5252
if len(out) != bytes_to_read:
53-
sys.stderr.write("Error reading out of bounds of file, exiting.")
53+
sys.stderr.write("Error reading out of bounds of file, exiting.\n")
5454
sys.exit(1)
5555

5656
return out
@@ -72,7 +72,7 @@ def parse_partition_table(fp):
7272
sector_size = 0x1000
7373

7474
if not sector_size:
75-
sys.stderr.write(f"[!] Invalid sector size {sector_size} (not 512 or 4096 bytes). Exiting.")
75+
sys.stderr.write(f"[!] Invalid sector size {sector_size} (not 512 or 4096 bytes). Exiting.\n")
7676
sys.exit(1)
7777

7878
fp.seek(2 * sector_size) # go to sector 2
@@ -335,7 +335,7 @@ def main():
335335

336336
core_storage_volumes = get_all_partitions_of_type(partition_dict, HEX_CORE_STORAGE_TYPE_GUID)
337337
if core_storage_volumes == []:
338-
sys.stderr.write("[!] No CoreStorage volumes found, exiting.")
338+
sys.stderr.write("[!] No CoreStorage volumes found, exiting\n")
339339
sys.exit(1)
340340
boot_volumes = get_all_partitions_of_type(partition_dict, HEX_APPLE_BOOT_STORAGE_TYPE_GUID)
341341

run/keystore2john.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def process_file(filename):
159159
certsize = struct.unpack("> I", buf)[0]
160160
certdata = fd.read(certsize)
161161
else:
162-
sys.stderr.write("Unrecognized keystore entry")
162+
sys.stderr.write("Unrecognized keystore entry\n")
163163
fd.close()
164164
return
165165

0 commit comments

Comments
 (0)