Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17e4c6b

Browse files
committed
minor update regarding mnemonics
1 parent 25b923b commit 17e4c6b

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

lib/core/common.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ def __init__(self):
26532653

26542654
if pointer in (None, head):
26552655
errMsg = "mnemonic '%s' can't be resolved to any parameter name" % name
2656-
logger.error(errMsg)
2656+
raise sqlmapSyntaxException, errMsg
26572657
elif len(pointer.current) > 1:
26582658
options = {}
26592659
for option in pointer.current:
@@ -2678,5 +2678,8 @@ def __init__(self):
26782678
value = found.convert_value(found, value)
26792679
if value is not None:
26802680
setattr(args, found.dest, value)
2681-
else:
2681+
elif not found.type: # boolean
26822682
setattr(args, found.dest, True)
2683+
else:
2684+
errMsg = "mnemonic '%s' requires value of type '%s'" % (name, found.type)
2685+
raise sqlmapSyntaxException, errMsg

sqlmap.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ def main():
6363
Main function of sqlmap when running from command line.
6464
"""
6565

66-
paths.SQLMAP_ROOT_PATH = modulePath()
67-
setPaths()
68-
banner()
66+
try:
67+
paths.SQLMAP_ROOT_PATH = modulePath()
68+
setPaths()
69+
banner()
6970

70-
# Store original command line options for possible later restoration
71-
cmdLineOptions.update(cmdLineParser().__dict__)
71+
# Store original command line options for possible later restoration
72+
cmdLineOptions.update(cmdLineParser().__dict__)
7273

73-
dataToStdout("[!] legal disclaimer: %s\n\n" % LEGAL_DISCLAIMER, forceOutput=True)
74-
dataToStdout("[*] starting at %s\n\n" % time.strftime("%X"), forceOutput=True)
74+
dataToStdout("[!] legal disclaimer: %s\n\n" % LEGAL_DISCLAIMER, forceOutput=True)
75+
dataToStdout("[*] starting at %s\n\n" % time.strftime("%X"), forceOutput=True)
7576

76-
try:
7777
init(cmdLineOptions)
7878
if conf.profile:
7979
profile()

0 commit comments

Comments
 (0)