File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5555from lib .core .convert import unicodeencode
5656from lib .core .convert import urldecode
5757from lib .core .convert import urlencode
58+ from lib .core .decorators import cachedmethod
5859from lib .core .enums import CHARSET_TYPE
5960from lib .core .enums import DBMS
6061from lib .core .enums import EXPECTED
@@ -492,15 +493,6 @@ def isVersionGreaterOrEqualThan(version):
492493 def isOs (os ):
493494 return Backend .getOs () is not None and Backend .getOs ().lower () == os .lower ()
494495
495- # Reference: http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/
496- def cachedmethod (f , cache = {}):
497- def _ (* args , ** kwargs ):
498- key = (f , tuple (args ), frozenset (kwargs .items ()))
499- if key not in cache :
500- cache [key ] = f (* args , ** kwargs )
501- return cache [key ]
502- return _
503-
504496def paramToDict (place , parameters = None ):
505497 """
506498 Split the parameters into names and values, check if these parameters
Original file line number Diff line number Diff line change 1+ # Reference: http://code.activestate.com/recipes/325205-cache-decorator-in-python-24/
2+ def cachedmethod (f , cache = {}):
3+ def _ (* args , ** kwargs ):
4+ key = (f , tuple (args ), frozenset (kwargs .items ()))
5+ if key not in cache :
6+ cache [key ] = f (* args , ** kwargs )
7+ return cache [key ]
8+ return _
Original file line number Diff line number Diff line change @@ -294,7 +294,6 @@ def getPasswordHashes(self):
294294 else :
295295 for user in kb .data .cachedUsersPasswords :
296296 kb .data .cachedUsersPasswords [user ] = list (set (kb .data .cachedUsersPasswords [user ]))
297-
298297
299298 message = "do you want to perform a dictionary-based attack "
300299 message += "against retrieved password hashes? [Y/n/q]"
You can’t perform that action at this time.
0 commit comments