Minor refactoring (#5965)

This commit is contained in:
Miroslav Stampar
2025-12-31 14:53:59 +01:00
parent ac2bd503d7
commit e1a509ebb7
5 changed files with 14 additions and 15 deletions

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.56"
VERSION = "1.9.12.57"
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)

View File

@@ -860,7 +860,7 @@ def cmdLineParser(argv=None):
parser.add_argument("--gui", dest="gui", action="store_true",
help=SUPPRESS)
parser.add_argument("--ncgui", dest="ncgui", action="store_true",
parser.add_argument("--tui", dest="tui", action="store_true",
help=SUPPRESS)
parser.add_argument("--smoke-test", dest="smokeTest", action="store_true",
@@ -936,16 +936,16 @@ def cmdLineParser(argv=None):
checkOldOptions(argv)
if "--gui" in argv:
from lib.core.gui import runGui
from lib.utils.gui import runGui
runGui(parser)
raise SqlmapSilentQuitException
elif "--ncgui" in argv:
from lib.core.ncgui import runNcGui
elif "--tui" in argv:
from lib.utils.tui import runTui
runNcGui(parser)
runTui(parser)
raise SqlmapSilentQuitException

View File

@@ -91,7 +91,7 @@ class NcursesUI:
def _draw_header(self):
"""Draw the header bar"""
height, width = self.stdscr.getmaxyx()
header = " sqlmap - Ncurses GUI "
header = " sqlmap - Ncurses TUI "
self.stdscr.attron(curses.color_pair(1) | curses.A_BOLD)
self.stdscr.addstr(0, 0, header.center(width))
self.stdscr.attroff(curses.color_pair(1) | curses.A_BOLD)
@@ -750,12 +750,11 @@ class NcursesUI:
if option['type'] == 'bool':
option['value'] = not option['value']
def runNcGui(parser):
"""Main entry point for ncurses GUI"""
def runTui(parser):
"""Main entry point for ncurses TUI"""
# Check if ncurses is available
if curses is None:
raise SqlmapMissingDependence("missing 'curses' module (try installing 'windows-curses' on Windows)")
raise SqlmapMissingDependence("missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)")
try:
# Initialize and run
def main(stdscr):