mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-08 05:31:32 +00:00
Minor patch related to the #2487
This commit is contained in:
@@ -3187,6 +3187,21 @@ def decodeIntToUnicode(value):
|
||||
|
||||
return retVal
|
||||
|
||||
def md5File(filename):
|
||||
"""
|
||||
Calculates MD5 digest of a file
|
||||
Reference: http://stackoverflow.com/a/3431838
|
||||
"""
|
||||
|
||||
checkFile(filename)
|
||||
|
||||
digest = hashlib.md5()
|
||||
with open(filename, "rb") as f:
|
||||
for chunk in iter(lambda: f.read(4096), ""):
|
||||
digest.update(chunk)
|
||||
|
||||
return digest.hexdigest()
|
||||
|
||||
def checkIntegrity():
|
||||
"""
|
||||
Checks integrity of code files during the unhandled exceptions
|
||||
@@ -3203,7 +3218,7 @@ def checkIntegrity():
|
||||
if not os.path.isfile(path):
|
||||
logger.error("missing file detected '%s'" % path)
|
||||
retVal = False
|
||||
elif hashlib.md5(open(path, 'rb').read()).hexdigest() != checksum:
|
||||
elif md5File(path) != checksum:
|
||||
logger.error("wrong checksum of file '%s' detected" % path)
|
||||
retVal = False
|
||||
return retVal
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.1.4.33"
|
||||
VERSION = "1.1.4.34"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
||||
Reference in New Issue
Block a user