Skip to content

Commit ef00b9f

Browse files
committed
Minor performance patch
1 parent 5c69124 commit ef00b9f

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ c03dc585f89642cfd81b087ac2723e3e1bb3bfa8c60e6f5fe58ef3b0113ebfe6 lib/core/data.
188188
48797d6c34dd9bb8a53f7f3794c85f4288d82a9a1d6be7fcf317d388cb20d4b3 lib/core/replication.py
189189
0b8c38a01bb01f843d94a6c5f2075ee47520d0c4aa799cecea9c3e2c5a4a23a6 lib/core/revision.py
190190
888daba83fd4a34e9503fe21f01fef4cc730e5cde871b1d40e15d4cbc847d56c lib/core/session.py
191-
d69a1586a6aae582afe790ecde487acd7e15aec192d687788ef532974051fe0b lib/core/settings.py
191+
872dd556f0197b8f51f62260cbf92a4bbf8f5f40f6f3af98df78e9a790f79a77 lib/core/settings.py
192192
cd5a66deee8963ba8e7e9af3dd36eb5e8127d4d68698811c29e789655f507f82 lib/core/shell.py
193193
bcb5d8090d5e3e0ef2a586ba09ba80eef0c6d51feb0f611ed25299fbb254f725 lib/core/subprocessng.py
194194
70ea3768f1b3062b22d20644df41c86238157ec80dd43da40545c620714273c6 lib/core/target.py
@@ -230,7 +230,7 @@ f522436fbd14bdab090a1d305fcac0361800cb8e36c8cbcb47933298376a71e0 lib/takeover/r
230230
f6e5d6e2ff368fa39943b2302982f33c47eb9a12d01419bef50fcf934b2bce34 lib/takeover/udf.py
231231
23d73af417604dab460b74cdc230896153f018a6c00d144019491053640a172f lib/takeover/web.py
232232
8cc1e226d4150fe8aa1a056e5d32d858ed6444d3d4e2af7fb4bc08f0bbe9d527 lib/takeover/xp_cmdshell.py
233-
69928272eed889033e106527f88454dc844bfbb375fcf7c22d5f76ee30c62c9b lib/techniques/blind/inference.py
233+
3609556c6c72010ce4cae5ffeeb74437a15a9dc218f77e079655f32e704fdeef lib/techniques/blind/inference.py
234234
1966ca704961fb987ab757f0a4afddbf841d1a880631b701487c75cef63d60c3 lib/techniques/blind/__init__.py
235235
1966ca704961fb987ab757f0a4afddbf841d1a880631b701487c75cef63d60c3 lib/techniques/dns/__init__.py
236236
3df9839fb92a81d46b6194d7adacb43f391efb78b071783c132e8d596ecbfaf1 lib/techniques/dns/test.py

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty import six
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.10.6.62"
23+
VERSION = "1.10.6.63"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/techniques/blind/inference.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ def getChar(idx, charTbl=None, continuousOrder=True, expand=charsetType is None,
512512
threadData.shared.value = [None] * length
513513
threadData.shared.index = [firstChar] # As list for python nested function scoping
514514
threadData.shared.start = firstChar
515+
threadData.shared.retrieved = 0
516+
threadData.shared.endIndex = 0
515517

516518
try:
517519
def blindThread():
@@ -537,33 +539,30 @@ def blindThread():
537539
break
538540

539541
with kb.locks.value:
540-
threadData.shared.value[currentCharIndex - 1 - firstChar] = val
542+
idx = currentCharIndex - 1 - firstChar
543+
threadData.shared.value[idx] = val
544+
threadData.shared.retrieved += 1
545+
if idx > threadData.shared.endIndex:
546+
threadData.shared.endIndex = idx
541547
currentValue = list(threadData.shared.value)
542548

543549
if kb.threadContinue:
544550
if showEta:
545551
progress.progress(threadData.shared.index[0])
546552
elif conf.verbose >= 1:
547553
startCharIndex = 0
548-
endCharIndex = 0
549-
550-
for i in xrange(length):
551-
if currentValue[i] is not None:
552-
endCharIndex = max(endCharIndex, i)
554+
endCharIndex = threadData.shared.endIndex
553555

554556
output = ''
555557

556558
if endCharIndex > conf.progressWidth:
557559
startCharIndex = endCharIndex - conf.progressWidth
558560

559-
count = threadData.shared.start
561+
count = threadData.shared.start + threadData.shared.retrieved
560562

561563
for i in xrange(startCharIndex, endCharIndex + 1):
562564
output += '_' if currentValue[i] is None else filterControlChars(currentValue[i] if len(currentValue[i]) == 1 else ' ', replacement=' ')
563565

564-
for i in xrange(length):
565-
count += 1 if currentValue[i] is not None else 0
566-
567566
if startCharIndex > 0:
568567
output = ".." + output[2:]
569568

0 commit comments

Comments
 (0)