Skip to content

Commit

Permalink
Fix various Python 3.12 SyntaxWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
elboulangero authored and solardiz committed Sep 17, 2024
1 parent 07aef97 commit 63f6c35
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion run/adxcsouf2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def process_file(filename):
return process_other_file(filename)

# find (username hash) pairs
matches = re.findall(b'([a-zA-Z0-9_-]{3,9})\ (\d{8})', data)
matches = re.findall(rb'([a-zA-Z0-9_-]{3,9})\ (\d{8})', data)

for items in matches:
try:
Expand Down
2 changes: 1 addition & 1 deletion run/aix2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def process_file(filename, is_standard):
username = "?"

for line in fd.readlines():
if re.match('^\s*\S+\s*:\s*$',line):
if re.match(r'^\s*\S+\s*:\s*$',line):
username = line.split(':')[0]

if "password = " in line and "smd5" in line:
Expand Down
4 changes: 2 additions & 2 deletions run/dashlane2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def process(filename, plaintext=None, cipher=0, md=0):
if len(sys.argv) < 2:
sys.stderr.write("Usage: %s <.aes or .dash files from Dashlane for Windows Desktop / macOS>\n" % sys.argv[0])
sys.stderr.write("\nNote: This only works with data from Windows and macOS Desktop version of Dashlane.\n")
sys.stderr.write("\nThe required .aes files can be found inside %AppData%\Dashlane\profiles directory tree on Windows.\n")
sys.stderr.write("\nThe required .aes files can be found inside ~/Library/Application\ Support/Dashlane/profiles/ directory tree on macOS.\n")
sys.stderr.write("\nThe required .aes files can be found inside %AppData%\\Dashlane\\profiles directory tree on Windows.\n")
sys.stderr.write("\nThe required .aes files can be found inside ~/Library/Application\\ Support/Dashlane/profiles/ directory tree on macOS.\n")
sys.exit(1)

for i in range(1, len(sys.argv)):
Expand Down
4 changes: 2 additions & 2 deletions run/ejabberd2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def transform(ast):


def lex(text):
grammar = Grammar("""\
grammar = Grammar(r"""
entry = (term _ "." _)* _
term = boolean / atom / list / tuple / map / string / binary / number
atom = ~"[a-z][0-9a-zA-Z_]*" / ("'" ~"[^']*" "'")
Expand All @@ -86,7 +86,7 @@ def lex(text):
tuple = ( _ "{" _ term (_ "," _ term)* _ "}" ) / ( _ "{" _ "}")
map = ( _ "#{" _ keyvalue (_ "," _ keyvalue)* _ "}" ) / ( _ "#{" _ "}")
keyvalue = term _ "=>" _ term _
string = '"' ~r'(\\\\.|[^"])*' '"'
string = '"' ~r'(\\.|[^"])*' '"'
binary = "<<" string ">>"
boolean = "true" / "false"
number = ~"\-?[0-9]+\#[0-9a-zA-Z]+" / ~"\-?[0-9]+(\.[0-9]+)?((e|E)(\-|\+)?[0-9]+)?"
Expand Down
2 changes: 1 addition & 1 deletion run/vmx2john.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


def process_file(target):
ks_re = '.+phrase/(.*?)/pass2key=(.*?):cipher=(.*?):rounds=(.*?):salt=(.*?),(.*?),(.*?)\)'
ks_re = r'.+phrase/(.*?)/pass2key=(.*?):cipher=(.*?):rounds=(.*?):salt=(.*?),(.*?),(.*?)\)'

name = "Unknown"
keysafe = None
Expand Down

0 comments on commit 63f6c35

Please sign in to comment.