MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / run

Method run

lib/utils/tui.py:699–753  ·  view source on GitHub ↗

Main UI loop

(self)

Source from the content-addressed store, hash-verified

697 del console_win
698
699 def run(self):
700 """Main UI loop"""
701 while True:
702 self.stdscr.clear()
703
704 # Draw UI
705 self._draw_header()
706 self._draw_tabs()
707 self._draw_current_tab()
708 self._draw_footer()
709
710 self.stdscr.refresh()
711
712 # Get input
713 key = self.stdscr.getch()
714
715 tab = self.tabs[self.current_tab]
716
717 # Handle input
718 if key == curses.KEY_F10 or key == 27: # F10 or ESC
719 break
720 elif key == ord('\t') or key == curses.KEY_RIGHT: # Tab or Right arrow
721 self.current_tab = (self.current_tab + 1) % len(self.tabs)
722 self.current_field = 0
723 self.scroll_offset = 0
724 elif key == curses.KEY_LEFT: # Left arrow
725 self.current_tab = (self.current_tab - 1) % len(self.tabs)
726 self.current_field = 0
727 self.scroll_offset = 0
728 elif key == curses.KEY_UP: # Up arrow
729 if self.current_field > 0:
730 self.current_field -= 1
731 # Adjust scroll if needed
732 if self.current_field < self.scroll_offset:
733 self.scroll_offset = self.current_field
734 elif key == curses.KEY_DOWN: # Down arrow
735 if self.current_field < len(tab['options']) - 1:
736 self.current_field += 1
737 # Adjust scroll if needed
738 height, width = self.stdscr.getmaxyx()
739 visible_lines = height - 8
740 if self.current_field >= self.scroll_offset + visible_lines:
741 self.scroll_offset = self.current_field - visible_lines + 1
742 elif key == curses.KEY_ENTER or key == 10 or key == 13: # Enter
743 self._edit_field()
744 elif key == curses.KEY_F2: # F2 to run
745 self._run_sqlmap()
746 elif key == curses.KEY_F3: # F3 to export
747 self._export_config()
748 elif key == curses.KEY_F4: # F4 to import
749 self._import_config()
750 elif key == ord(' '): # Space for boolean toggle
751 option = tab['options'][self.current_field]
752 if option['type'] == 'bool':
753 option['value'] = not option['value']
754
755def runTui(parser):
756 """Main entry point for ncurses TUI"""

Callers 4

mainFunction · 0.95
profileFunction · 0.45
_threadFunction · 0.45
_setDNSServerFunction · 0.45

Calls 9

_draw_headerMethod · 0.95
_draw_tabsMethod · 0.95
_draw_current_tabMethod · 0.95
_draw_footerMethod · 0.95
_edit_fieldMethod · 0.95
_run_sqlmapMethod · 0.95
_export_configMethod · 0.95
_import_configMethod · 0.95
clearMethod · 0.45

Tested by 1

_threadFunction · 0.36