@@ -95,6 +95,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
95
95
showEta = conf .eta and isinstance (length , int )
96
96
numThreads = min (conf .threads , length )
97
97
threads = []
98
+ totalWidth = 54
98
99
99
100
if showEta :
100
101
progress = ProgressBar (maxValue = length )
@@ -105,7 +106,7 @@ def bisection(payload, expression, length=None, charsetType=None, firstChar=None
105
106
infoMsg = "starting %d threads" % numThreads
106
107
logger .info (infoMsg )
107
108
108
- dataToStdout ("[%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), "_" * length ))
109
+ dataToStdout ("[%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), "_" * min ( length , totalWidth ) ))
109
110
dataToStdout ("\r [%s] [INFO] retrieved: " % time .strftime ("%X" ))
110
111
else :
111
112
dataToStdout ("[%s] [INFO] retrieved: " % time .strftime ("%X" ))
@@ -184,9 +185,27 @@ def downloadThread():
184
185
if showEta :
185
186
etaProgressUpdate (time .time () - charStart , index [0 ])
186
187
elif conf .verbose >= 1 :
187
- s = "" .join ([c or "_" for c in value ])
188
+ startCharIndex = 0
189
+ endCharIndex = 0
190
+ for i in xrange (length ):
191
+ if value [i ] is not None :
192
+ endCharIndex = max (endCharIndex , i )
193
+ output = ''
194
+ if endCharIndex > totalWidth :
195
+ startCharIndex = endCharIndex - totalWidth
196
+ count = 0
197
+ for i in xrange (startCharIndex , endCharIndex ):
198
+ output += '_' if value [i ] is None else value [i ]
199
+ for i in xrange (length ):
200
+ count += 1 if value [i ] is not None else 0
201
+ if startCharIndex > 0 :
202
+ output = '...' + output [3 :]
203
+ if endCharIndex - startCharIndex == totalWidth :
204
+ output = output [:- 3 ] + '...'
205
+ status = ' %d/%d' % (count , length )
206
+ output += status if count != length else " " * len (status )
188
207
iolock .acquire ()
189
- dataToStdout ("\r [%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), s ))
208
+ dataToStdout ("\r [%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), output ))
190
209
iolock .release ()
191
210
192
211
except (sqlmapConnectionException , sqlmapValueException ), errMsg :
0 commit comments