Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions run/office2john.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/usr/bin/env python3
#
# This software is Copyright (c) 2012-2013 Dhiru Kholia <dhiru at openwall.com>
# and Copyright (c) 2013-2025 magnum,
# and Copyright (c) 2013-2026 magnum,
# and is hereby released to the general public under the following terms:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.

from olefile import isOleFile, OleFileIO
import sys
import os

try:
from olefile import isOleFile, OleFileIO
except ImportError:
print(f"{os.path.basename(sys.argv[0])}: olefile python module is missing, please install your distro's", file=sys.stderr)
print("package, eg. 'sudo apt-get install python3-olefile' if available, otherwise", file=sys.stderr)
print("'pip install --user olefile' (activate your venv if you already did that)", file=sys.stderr)
sys.exit(1)

PY3 = sys.version_info[0] == 3

if not PY3:
Expand Down