Minor patches

This commit is contained in:
Miroslav Stampar
2025-12-28 01:17:19 +01:00
parent e4960ce747
commit 673a7a5ff8
4 changed files with 15 additions and 9 deletions

View File

@@ -3339,14 +3339,14 @@ def filterNone(values):
"""
Emulates filterNone([...]) functionality
>>> filterNone([1, 2, "", None, 3])
[1, 2, 3]
>>> filterNone([1, 2, "", None, 3, 0])
[1, 2, 3, 0]
"""
retVal = values
if isinstance(values, _collections.Iterable):
retVal = [_ for _ in values if _]
retVal = [_ for _ in values if _ or _ == 0]
return retVal

View File

@@ -58,7 +58,7 @@ def base64pickle(value):
try:
retVal = encodeBase64(pickle.dumps(value), binary=False)
except:
retVal = encodeBase64(pickle.dumps(str(value), PICKLE_PROTOCOL), binary=False)
raise
return retVal
@@ -146,13 +146,19 @@ def rot13(data):
'sbbone jnf urer!!'
>>> rot13('sbbone jnf urer!!')
'foobar was here!!'
>>> rot13(b'foobar was here!!')
'sbbone jnf urer!!'
"""
# Reference: https://stackoverflow.com/a/62662878
retVal = ""
alphabit = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
if isinstance(data, six.binary_type):
data = getText(data)
for char in data:
retVal += alphabit[alphabit.index(char) + 13] if char in alphabit else char
return retVal
def decodeHex(value, binary=True):

View File

@@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.9.12.22"
VERSION = "1.9.12.23"
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)