mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-28 20:43:49 +03:00
Minor refactoring of some revisited code
This commit is contained in:
parent
fc5802f461
commit
dd8fcaeb43
|
@ -801,10 +801,10 @@ def cmdLineParser(argv=None):
|
|||
|
||||
# Dirty hack to display longer options without breaking into two lines
|
||||
def _(self, *args):
|
||||
_ = parser.formatter._format_option_strings(*args)
|
||||
if len(_) > MAX_HELP_OPTION_LENGTH:
|
||||
_ = ("%%.%ds.." % (MAX_HELP_OPTION_LENGTH - parser.formatter.indent_increment)) % _
|
||||
return _
|
||||
retVal = parser.formatter._format_option_strings(*args)
|
||||
if len(retVal) > MAX_HELP_OPTION_LENGTH:
|
||||
retVal = ("%%.%ds.." % (MAX_HELP_OPTION_LENGTH - parser.formatter.indent_increment)) % retVal
|
||||
return retVal
|
||||
|
||||
parser.formatter._format_option_strings = parser.formatter.format_option_strings
|
||||
parser.formatter.format_option_strings = type(parser.formatter.format_option_strings)(_, parser, type(parser))
|
||||
|
|
|
@ -116,29 +116,29 @@ def pivotDumpTable(table, colList, count=None, blind=True):
|
|||
pivotValue = " "
|
||||
breakRetrieval = False
|
||||
|
||||
def _(column, pivotValue):
|
||||
if column == colList[0]:
|
||||
query = dumpNode.query.replace("'%s'", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, column), unescaper.escape(pivotValue, False))
|
||||
else:
|
||||
query = dumpNode.query2.replace("'%s'", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, colList[0]), unescaper.escape(pivotValue, False))
|
||||
|
||||
query = whereQuery(query)
|
||||
return unArrayizeValue(inject.getValue(query, blind=blind, time=blind, union=not blind, error=not blind))
|
||||
|
||||
try:
|
||||
for i in xrange(count):
|
||||
if breakRetrieval:
|
||||
break
|
||||
|
||||
for column in colList:
|
||||
def _(pivotValue):
|
||||
if column == colList[0]:
|
||||
query = dumpNode.query.replace("'%s'", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, column), unescaper.escape(pivotValue, False))
|
||||
else:
|
||||
query = dumpNode.query2.replace("'%s'", "%s") % (agent.preprocessField(table, column), table, agent.preprocessField(table, colList[0]), unescaper.escape(pivotValue, False))
|
||||
|
||||
query = whereQuery(query)
|
||||
|
||||
return unArrayizeValue(inject.getValue(query, blind=blind, time=blind, union=not blind, error=not blind))
|
||||
|
||||
value = _(pivotValue)
|
||||
value = _(column, pivotValue)
|
||||
if column == colList[0]:
|
||||
if isNoneValue(value):
|
||||
for pivotValue in filter(None, (" " if pivotValue == " " else None, "%s%s" % (pivotValue[0], unichr(ord(pivotValue[1]) + 1)) if len(pivotValue) > 1 else None, unichr(ord(pivotValue[0]) + 1))):
|
||||
value = _(pivotValue)
|
||||
value = _(column, pivotValue)
|
||||
if not isNoneValue(value):
|
||||
break
|
||||
|
||||
if isNoneValue(value):
|
||||
breakRetrieval = True
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user