void LineCallback(asIScriptContext *ctx)
	{
		if( ctx->GetState() == asEXECUTION_ACTIVE )
		{
			// Call the command for listing local variables
			InterpretCommand("l v", ctx);

			// Call the command for listing global variables
			InterpretCommand("l g", ctx);

			// Invoke the original line callback
			CDebugger::LineCallback(ctx);
		}
	}
Ejemplo n.º 2
0
//++ ------------------------------------------------------------------------------------
// Details: Execute commands from command source file in specified mode, and
//          set exit-flag if needed.
// Type:    Method.
// Args:    vbAsyncMode       - (R) True = execute commands in asynchronous mode, false = otherwise.
// Return:  MIstatus::success - Function succeeded.
//          MIstatus::failure - Function failed.
// Throws:  None.
//--
bool
CMIDriver::ExecuteCommandFile(const bool vbAsyncMode)
{
    std::ifstream ifsStartScript(m_strCmdLineArgCommandFileNamePath.c_str());
    if (!ifsStartScript.is_open())
    {
        const CMIUtilString errMsg(
            CMIUtilString::Format(MIRSRC(IDS_UTIL_FILE_ERR_OPENING_FILE_UNKNOWN), m_strCmdLineArgCommandFileNamePath.c_str()));
        SetErrorDescription(errMsg.c_str());
        const bool bForceExit = true;
        SetExitApplicationFlag(bForceExit);
        return MIstatus::failure;
    }

    // Switch lldb to synchronous mode
    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
    const bool bAsyncSetting = rSessionInfo.GetDebugger().GetAsync();
    rSessionInfo.GetDebugger().SetAsync(vbAsyncMode);

    // Execute commands from file
    bool bOk = MIstatus::success;
    CMIUtilString strCommand;
    while (!m_bExitApp && std::getline(ifsStartScript, strCommand))
    {
        // Print command
        bOk = CMICmnStreamStdout::TextToStdout(strCommand);

        // Skip if it's a comment or empty line
        if (strCommand.empty() || strCommand[0] == '#')
            continue;

        // Execute if no error
        if (bOk)
        {
            CMIUtilThreadLock lock(rSessionInfo.GetSessionMutex());
            bOk = InterpretCommand(strCommand);
        }

        // Draw the prompt after command will be executed (if enabled)
        bOk = bOk && CMICmnStreamStdout::WritePrompt();

        // Exit if there is an error
        if (!bOk)
        {
            const bool bForceExit = true;
            SetExitApplicationFlag(bForceExit);
            break;
        }

        // Wait while the handler thread handles incoming events
        CMICmnLLDBDebugger::Instance().WaitForHandleEvent();
    }

    // Switch lldb back to initial mode
    rSessionInfo.GetDebugger().SetAsync(bAsyncSetting);

    return bOk;
}
Ejemplo n.º 3
0
//++ ------------------------------------------------------------------------------------
// Details: Execute commands (by injecting them into the stdin line queue container) and
//          other code to set up the MI Driver such that is can take the executable
//          argument passed on the command and create a debug session for it.
// Type:    Method.
// Args:    None.
// Return:  MIstatus::success - Functionality succeeded.
//          MIstatus::failure - Functionality failed.
// Throws:  None.
//--
bool
CMIDriver::LocalDebugSessionStartupExecuteCommands(void)
{
    const CMIUtilString strCmd(CMIUtilString::Format("-file-exec-and-symbols \"%s\"", m_strCmdLineArgExecuteableFileNamePath.AddSlashes().c_str()));
    bool bOk = CMICmnStreamStdout::TextToStdout(strCmd);
    bOk = bOk && InterpretCommand(strCmd);
    bOk = bOk && CMICmnStreamStdout::WritePrompt();
    return bOk;
}
Ejemplo n.º 4
0
void MenuExecuteCommand(MenuInstanceData* menu_data, const string& command) {
  MenuRec menu;
  if (menu_data->LoadMenuRecord(command, &menu)) {
    LogUserFunction(menu_data, command, &menu);
    InterpretCommand(menu_data, menu.szExecute);
  } else {
    LogUserFunction(menu_data, command, &menu);
  }
}
Ejemplo n.º 5
0
//++ ------------------------------------------------------------------------------------
// Details:	*this driver sits and waits for input to the stdin line queue shared by *this
//			driver and the stdin monitor thread, it queues, *this reads, interprets and
//			reacts.
//			This function is used by the application's main thread.
// Type:	Method.
// Args:	None.
// Return:	MIstatus::success - Functional succeeded.
//			MIstatus::failure - Functional failed.
// Throws:	None.
//--
bool CMIDriver::ReadStdinLineQueue( void )
{
	// True when queue contains input
	bool bHaveInput = false;

	// Stores the current input line
	CMIUtilString lineText;
	{
		// Lock while we access the queue
		CMIUtilThreadLock lock( m_threadMutex );
		if( !m_queueStdinLine.empty() )
		{
			lineText = m_queueStdinLine.front();
			m_queueStdinLine.pop();
			bHaveInput = !lineText.empty();
		}
	}

	// Process while we have input
	if( bHaveInput )
	{
		if( lineText == "quit" )
		{
			// We want to be exiting when receiving a quit command
			m_bExitApp = true;
			return MIstatus::success;
		}

		// Process the command
		const bool bOk = InterpretCommand( lineText );

		// Draw prompt if desired
		if( bOk && m_rStdin.GetEnablePrompt() )
			m_rStdOut.WriteMIResponse( m_rStdin.GetPrompt() );

		// Input has been processed
		bHaveInput = false;
	}
	else
	{
		// Give resources back to the OS
		const std::chrono::milliseconds time( 1 );
		std::this_thread::sleep_for( time );
	}
	
	return MIstatus::success;
}
Ejemplo n.º 6
0
bool MenuInstanceData::Open() {
  Close();

  // Open up the main data file
  unique_ptr<File> menu_file(new File(create_menu_filename("mnu")));
  if (!menu_file->Open(File::modeBinary | File::modeReadOnly, File::shareDenyNone))  {
    // Unable to open menu
    MenuSysopLog("Unable to open Menu");
    return false;
  }

  // Read the header (control) record into memory
  menu_file->Seek(0L, File::seekBegin);
  menu_file->Read(&header, sizeof(MenuHeader));

  // Version numbers can be checked here.
  if (!CreateMenuMap(menu_file.get())) {
    MenuSysopLog("Unable to create menu index.");
    return false;
  }

  if (!CheckMenuSecurity(&header, true)) {
    MenuSysopLog("< Menu Sec");
    return false;
  }

  // Open/Rease/Close Prompt file.  We use binary mode since we want the
  // \r to remain on windows (and linux).
  TextFile prompt_file(create_menu_filename("pro"), "rb");
  if (prompt_file.IsOpen()) {
    string tmp = prompt_file.ReadFileIntoString();
    string::size_type end = tmp.find(".end.");
    if (end != string::npos) {
      prompt = tmp.substr(0, end);
    } else {
      prompt = tmp;
    }
  }

  // Execute command to use on entering the menu (if any).
  if (header.szScript[0]) {
    InterpretCommand(this, header.szScript);
  }
  return true;
}
Ejemplo n.º 7
0
//++ ------------------------------------------------------------------------------------
// Details: Set the MI Driver's exit application flag. The application checks this flag
//          after every stdin line is read so the exit may not be instantaneous.
//          If vbForceExit is false the MI Driver queries its state and determines if is
//          should exit or continue operating depending on that running state.
//          This is related to the running state of the MI driver.
// Type:    Overridden.
// Args:    None.
// Return:  None.
// Throws:  None.
//--
void
CMIDriver::SetExitApplicationFlag(const bool vbForceExit)
{
    if (vbForceExit)
    {
        CMIUtilThreadLock lock(m_threadMutex);
        m_bExitApp = true;
        return;
    }

    // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
    // Did we receive a SIGINT from the client during a running debug program, if
    // so then SIGINT is not to be taken as meaning kill the MI driver application
    // but halt the inferior program being debugged instead
    if (m_eCurrentDriverState == eDriverState_RunningDebugging)
    {
        InterpretCommand("-exec-interrupt");
        return;
    }

    m_bExitApp = true;
}
Ejemplo n.º 8
0
	void TakeCommands(asIScriptContext *ctx)
	{
		// Simulate the user stepping through the execution
		InterpretCommand("s", ctx);
	}
Ejemplo n.º 9
0
//++ ------------------------------------------------------------------------------------
// Details: Call this function puts *this driver to work.
//          This function is used by the application's main thread.
// Type:    Overridden.
// Args:    None.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool
CMIDriver::DoMainLoop(void)
{
    if (!InitClientIDEToMIDriver()) // Init Eclipse IDE
    {
        SetErrorDescriptionn(MIRSRC(IDS_MI_INIT_ERR_CLIENT_USING_DRIVER));
        return MIstatus::failure;
    }

    if (!StartWorkerThreads())
        return MIstatus::failure;

    bool bOk = MIstatus::success;

    if (HaveExecutableFileNamePathOnCmdLine())
    {
        if (!LocalDebugSessionStartupExecuteCommands())
        {
            SetErrorDescription(MIRSRC(IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION));
            bOk = MIstatus::failure;
        }
    }

    // App is not quitting currently
    m_bExitApp = false;

    // Handle source file
    if (m_bHaveCommandFileNamePathOnCmdLine)
    {
        const bool bAsyncMode = false;
        ExecuteCommandFile(bAsyncMode);
    }

    // While the app is active
    while (bOk && !m_bExitApp)
    {
        CMIUtilString errorText;
        const char *pCmd = m_rStdin.ReadLine (errorText);
        if (pCmd != nullptr)
        {
            CMIUtilString lineText(pCmd);
            if (!lineText.empty ())
            {
                // Check that the handler thread is alive (otherwise we stuck here)
                assert(CMICmnLLDBDebugger::Instance().ThreadIsActive());

                {
                    // Lock Mutex before processing commands so that we don't disturb an event
                    // being processed
                    CMIUtilThreadLock lock(CMICmnLLDBDebugSessionInfo::Instance().GetSessionMutex());
                    bOk = InterpretCommand(lineText);
                }

                // Draw prompt if desired
                bOk = bOk && CMICmnStreamStdout::WritePrompt();

                // Wait while the handler thread handles incoming events
                CMICmnLLDBDebugger::Instance().WaitForHandleEvent();
            }
        }
    }

    // Signal that the application is shutting down
    DoAppQuit();

    // Close and wait for the workers to stop
    StopWorkerThreads();

    // Ensure that a new line is sent as the last act of the dying driver
    m_rStdOut.WriteMIResponse("\n", false);

    return MIstatus::success;
}
Ejemplo n.º 10
0
//++ ------------------------------------------------------------------------------------
// Details: Gets called when lldb-mi gets a signal. Stops the process if it was SIGINT.
//
// Type:    Method.
// Args:    signal that was delivered
// Return:  None.
// Throws:  None.
//--
void
CMIDriver::DeliverSignal(int signal)
{
    if (signal == SIGINT && (m_eCurrentDriverState == eDriverState_RunningDebugging))
        InterpretCommand("-exec-interrupt");
}
Ejemplo n.º 11
0
int _cdecl main(int argc, char *argv[])
{
    SC_HANDLE               hSCManager = NULL;
    SC_HANDLE               hService = NULL;
    SERVICE_STATUS_PROCESS  serviceInfo;
    DWORD                   bytesNeeded;
    HANDLE                  hDevice = NULL;
    BOOL                    bResult;
    DWORD                   result;
    ULONG                   threadId;
    HANDLE                  thread = NULL;
    LOG_CONTEXT             context;
    INT                     inputChar;


    //
    // Initialize handle in case of error
    //

    context.ShutDown = NULL;
    context.VerbosityFlags = 0;

    //
    // Start the kernel mode driver through the service manager
    //
    
    hSCManager = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS) ;
    if (NULL == hSCManager) {
        result = GetLastError();
        printf("ERROR opening Service Manager...\n");
        DisplayError( result );
        goto Main_Continue;
    }


    hService = OpenService( hSCManager,
                            FILESPY_SERVICE_NAME,
                            FILESPY_SERVICE_ACCESS);

    if (NULL == hService) {
        result = GetLastError();
        printf("ERROR opening FileSpy Service...\n");
        DisplayError( result );
        goto Main_Continue;
    }

    if (!QueryServiceStatusEx( hService,
                               SC_STATUS_PROCESS_INFO,
                               (UCHAR *)&serviceInfo,
                               sizeof(serviceInfo),
                               &bytesNeeded))
    {
        result = GetLastError();
        printf("ERROR querrying status of FileSpy Service...\n");
        DisplayError( result );
        goto Main_Continue;
    }

    if(serviceInfo.dwCurrentState != SERVICE_RUNNING) {
        //
        // Service hasn't been started yet, so try to start service
        //
        if (!StartService(hService, 0, NULL)) {
            result = GetLastError();
            printf("ERROR starting FileSpy service...\n");
            DisplayError( result );
            goto Main_Continue;
        }
    }
   

Main_Continue:
    printf("Hit [Enter] to begin command mode...\n");

    //
    //  Open the device that is used to talk to FileSpy.
    //
    printf("FileSpy:  Opening device...\n");
    
    hDevice = CreateFile( FILESPY_W32_DEVICE_NAME,
                          GENERIC_READ | GENERIC_WRITE,
                          0,
                          NULL,
                          OPEN_EXISTING,
                          FILE_ATTRIBUTE_NORMAL,
                          NULL);
    if (hDevice == INVALID_HANDLE_VALUE) {
        result = GetLastError();
        printf("ERROR opening device...\n");
        DisplayError( result );
        goto Main_Exit;
    }
    
    //
    //  Initialize the fields of the LOG_CONTEXT.
    //
    context.Device = hDevice;
    context.ShutDown = CreateSemaphore(
        NULL, 
        0, 
        1, 
        L"FileSpy shutdown");

    if (context.ShutDown == NULL) {
        //
        //  Insufficient memory for this semaphore, so shutdown.
        //

        printf( "ERROR insufficient memory\n" );
        goto Main_Exit;
    }
    
    context.CleaningUp = FALSE;
    context.LogToScreen = context.NextLogToScreen = TRUE;
    context.LogToFile = FALSE;
    context.OutputFile = NULL;

    //
    // Check the valid parameters for startup
    //
    if (argc > 1) {
        if (InterpretCommand(argc - 1, &(argv[1]), &context) == USAGE_ERROR) {
            goto Main_Exit;
        }
    }

    //
    // Propagate the /s switch to the variable that the logging
    // thread checks.
    //
    context.LogToScreen = context.NextLogToScreen;

    //
    // Check to see what devices we are attached to from
    // previous runs of this program.
    //
    bResult = ListDevices(&context);
    if (!bResult) {
        result = GetLastError();
        printf("ERROR listing devices...\n");
        DisplayError( result );
    }

    //
    // Create the thread to read the log records that are gathered
    // by filespy.sys.
    //
    printf("FileSpy:  Creating logging thread...\n");
    thread = CreateThread(
        NULL,
        0,
        RetrieveLogRecords,
        (LPVOID)&context,
        0,
        &threadId);
    if (!thread) {
        result = GetLastError();
        printf("ERROR creating logging thread...\n");
        DisplayError( result );
        goto Main_Exit;
    }

    while (inputChar = getchar()) {
        CHAR    commandLine[81];
        INT     parmCount, count, ch;
        CHAR  **parms;
        BOOLEAN newParm;
        DWORD   returnValue = SUCCESS;

        if (inputChar == '\n') {
            //
            // Start command interpreter.  First we must turn off logging
            // to screen if we are.  Also, remember the state of logging
            // to the screen, so that we can reinstate that when command
            // interpreter is finished.
            //
            context.NextLogToScreen = context.LogToScreen;
            context.LogToScreen = FALSE;

            while (returnValue != EXIT_INTERPRETER) {
                //
                // Print prompt
                //
                printf(">");

                //
                // Read in next line, keeping track of the number of parameters 
                // as you go
                //
                parmCount = 1;
                for (count = 0; 
                     (count < 80) && ((ch = getchar())!= '\n'); 
                     count++) {
                    commandLine[count] = (CHAR)ch;
                    if (ch == ' ') {
                        parmCount ++;
                    }
                }
                commandLine[count] = '\0';
    
                parms = (CHAR **)malloc(parmCount * sizeof(CHAR *));
    
                parmCount = 0;
                newParm = TRUE;
                for (count = 0; commandLine[count] != '\0'; count++) {
                    if (newParm) {
                        parms[parmCount] = &(commandLine[count]);
                        parmCount ++;
                    }
                    if (commandLine[count] == ' ' ) {
                        newParm = TRUE;
                    } else {
                        newParm = FALSE;
                    }
                }
    
                //
                // We've got our parameter count and parameter list, so
                // send it off to be interpreted.
                //
                returnValue = InterpretCommand(parmCount, parms, &context);
                free(parms);
                if (returnValue == EXIT_PROGRAM) {
                    // Time to stop the program
                    goto Main_Cleanup;
                }
            }

            // Set LogToScreen appropriately based on any commands seen
            context.LogToScreen = context.NextLogToScreen;

            if (context.LogToScreen) {
                printf("Should be logging to screen...\n");
            }
        }
    }

Main_Cleanup:
    //
    // Clean up the threads, then fall through to Main_Exit
    //

    printf("FileSpy:  Cleaning up...\n");
    // 
    // Set the Cleaning up flag to TRUE to notify other threads
    // that we are cleaning up
    //
    context.CleaningUp = TRUE;

    // 
    // Wait for everyone to shut down
    //
    WaitForSingleObject(context.ShutDown, INFINITE);
    if (context.LogToFile) {
        fclose(context.OutputFile);
    }

Main_Exit:
    // 
    // Clean up the data that is always around and exit
    //
    if(context.ShutDown) {
        CloseHandle(context.ShutDown);
    }
    if (thread) {
        CloseHandle(thread);
    }

    if(hSCManager) {
        CloseServiceHandle(hSCManager);
    }
    if(hService) {
        CloseServiceHandle(hService);
    }
    if (hDevice) {
        CloseHandle(hDevice);
    }
    
    printf("FileSpy:  All done\n");
    return 0;  

}
Ejemplo n.º 12
0
//++ ------------------------------------------------------------------------------------
// Details: Call this function puts *this driver to work.
//          This function is used by the application's main thread.
// Type:    Overridden.
// Args:    None.
// Return:  MIstatus::success - Functional succeeded.
//          MIstatus::failure - Functional failed.
// Throws:  None.
//--
bool
CMIDriver::DoMainLoop(void)
{
    if (!InitClientIDEToMIDriver()) // Init Eclipse IDE
    {
        SetErrorDescriptionn(MIRSRC(IDS_MI_INIT_ERR_CLIENT_USING_DRIVER));
        return MIstatus::failure;
    }

    if (!StartWorkerThreads())
        return MIstatus::failure;

    bool bOk = MIstatus::success;

    if (HaveExecutableFileNamePathOnCmdLine())
    {
        if (!LocalDebugSessionStartupExecuteCommands())
        {
            SetErrorDescription(MIRSRC(IDS_MI_INIT_ERR_LOCAL_DEBUG_SESSION));
            bOk = MIstatus::failure;
        }
    }

    // App is not quitting currently
    m_bExitApp = false;

    // While the app is active
    while (bOk && !m_bExitApp)
    {
        CMIUtilString errorText;
        const MIchar *pCmd = m_rStdin.ReadLine (errorText);
        if (pCmd != nullptr)
        {
            CMIUtilString lineText(pCmd);
            if (!lineText.empty ())
            {
                if (lineText == "quit")
                {
                    // We want to be exiting when receiving a quit command
                    m_bExitApp = true;
                    break;
                }

                {
                    // Lock Mutex before processing commands so that we don't disturb an event
                    // being processed
                    CMIUtilThreadLock lock(CMICmnLLDBDebugSessionInfo::Instance().GetSessionMutex());
                    bOk = InterpretCommand(lineText);
                }
                // Draw prompt if desired
                if (bOk && m_rStdin.GetEnablePrompt())
                    bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt());
            }
        }
    }

    // Signal that the application is shutting down
    DoAppQuit();

    // Close and wait for the workers to stop
    StopWorkerThreads();

    // Ensure that a new line is sent as the last act of the dying driver
    m_rStdOut.WriteMIResponse("\n", false);

    return MIstatus::success;
}
Ejemplo n.º 13
0
void InterpretCommand(MenuInstanceData * pMenuData, const char *pszScript) {
  char szCmd[31], szParam1[51], szParam2[51];
  char szTempScript[ 255 ];
  memset(szTempScript, 0, sizeof(szTempScript));
  strncpy(szTempScript, pszScript, 250);

  if (pszScript[0] == 0) {
    return;
  }

  char* pszScriptPointer = szTempScript;
  while (pszScriptPointer && !hangup) {
    pszScriptPointer = MenuParseLine(pszScriptPointer, szCmd, szParam1, szParam2);

    if (szCmd[0] == 0) {    // || !pszScriptPointer || !*pszScriptPointer
      break;
    }

    // -------------------------
    // Run a new menu instance

    int nCmdID = GetMenuIndex(szCmd);
    switch (nCmdID) {
    case 0: {
      // "MENU"
      // Spawn a new menu
      MenuInstanceData *pNewMenuData = static_cast<MenuInstanceData *>(malloc(sizeof(MenuInstanceData)));

      memset(pNewMenuData, 0, sizeof(MenuInstanceData));
      pNewMenuData->nFinished = 0;
      pNewMenuData->nReload = 0;

      Menus(pNewMenuData, pMenuData->szPath, szParam1);
      free(pNewMenuData);
    }
    break;
    case 1: {
      // -------------------------
      // Exit out of this instance
      // of the menu
      // -------------------------
      // "ReturnFromMenu"
      InterpretCommand(pMenuData, pMenuData->header.szExitScript);
      pMenuData->nFinished = 1;
    }
    break;
    case 2: {
      // "EditMenuSet"
      EditMenus();           // flag if we are editing this menu
      pMenuData->nFinished = 1;
      pMenuData->nReload = 1;
    }
    break;
    case 3: {
      // "DLFreeFile"
      align(szParam2);
      MenuDownload(szParam1, szParam2, true, true);
    }
    break;
    case 4: {
      // "DLFile"
      align(szParam2);
      MenuDownload(szParam1, szParam2, false, true);
    }
    break;
    case 5: {
      // "RunDoor"
      MenuRunDoorName(szParam1, false);
    }
    break;
    case 6: {
      // "RunDoorFree"
      MenuRunDoorName(szParam1, true);
    }
    break;
    case 7: {
      // "RunDoorNumber"
      int nTemp = atoi(szParam1);
      MenuRunDoorNumber(nTemp, false);
    }
    break;
    case 8: {
      // "RunDoorNumberFree"
      int nTemp = atoi(szParam1);
      MenuRunDoorNumber(nTemp, true);
    }
    break;
    case 9: {
      // "PrintFile"
      printfile(szParam1, true);
    }
    break;
    case 10: {
      // "PrintFileNA"
      printfile(szParam1, false);
    }
    break;
    case 11: {
      // "SetSubNumber"
      SetSubNumber(szParam1);
    }
    break;
    case 12: {
      // "SetDirNumber"
      SetDirNumber(szParam1);
    }
    break;
    case 13: {
      // "SetMsgConf"
      SetMsgConf(szParam1[0]);
    }
    break;
    case 14: {
      // "SetDirConf"
      SetDirConf(szParam1[0]);
    }
    break;
    case 15: {
      // "EnableConf"
      EnableConf();
    }
    break;
    case 16: {
      // "DisableConf"
      DisableConf();
    }
    break;
    case 17: {
      // "Pause"
      pausescr();
    }
    break;
    case 18: {
      // "ConfigUserMenuSet"
      ConfigUserMenuSet();
      pMenuData->nFinished = 1;
      pMenuData->nReload = 1;
    }
    break;
    case 19: {
      // "DisplayHelp"
      if (GetSession()->GetCurrentUser()->IsExpert()) {
        AMDisplayHelp(pMenuData);
      }
    }
    break;
    case 20: {
      // "SelectSub"
      ChangeSubNumber();
    }
    break;
    case 21: {
      // "SelectDir"
      ChangeDirNumber();
    }
    break;
    case 22: {
      // "SubList"
      SubList();
    }
    break;
    case 23: {
      // "UpSubConf"
      UpSubConf();
    }
    break;
    case 24: {
      // "DownSubConf"
      DownSubConf();
    }
    break;
    case 25: {
      // "UpSub"
      UpSub();
    }
    break;
    case 26: {
      // "DownSub"
      DownSub();
    }
    break;
    case 27: {
      // "ValidateUser"
      ValidateUser();
    }
    break;
    case 28: {
      // "Doors"
      Chains();
    }
    break;
    case 29: {
      // "TimeBank"
      TimeBank();
    }
    break;
    case 30: {
      // "AutoMessage"
      AutoMessage();
    }
    break;
    case 31: {
      // "BBSList"
      BBSList();
    }
    break;
    case 32: {
      // "RequestChat"
      RequestChat();
    }
    break;
    case 33: {
      // "Defaults"
      Defaults(pMenuData);
    }
    break;
    case 34: {
      // "SendEMail"
      SendEMail();
    }
    break;
    case 35: {
      // "Feedback"
      FeedBack();
    }
    break;
    case 36: {
      // "Bulletins"
      Bulletins();
    }
    break;
    case 37: {
      // "HopSub"
      HopSub();
    }
    break;
    case 38: {
      // "SystemInfo"
      SystemInfo();
    }
    break;
    case 39: {
      // "JumpSubConf"
      JumpSubConf();
    }
    break;
    case 40: {
      // "KillEMail"
      KillEMail();
    }
    break;
    case 41: {
      // "LastCallers"
      LastCallers();
    }
    break;
    case 42: {
      // "ReadEMail"
      ReadEMail();
    }
    break;
    case 43: {
      // "NewMessageScan"
      NewMessageScan();
    }
    break;
    case 44: {
      // "Goodbye"
      GoodBye();
    }
    break;
    case 45: {
      // "PostMessage"
      WWIV_PostMessage();
    }
    break;
    case 46: {
      // "NewMsgScanCurSub"
      ScanSub();
    }
    break;
    case 47: {
      // "RemovePost"
      RemovePost();
    }
    break;
    case 48: {
      // "TitleScan"
      TitleScan();
    }
    break;
    case 49: {
      // "ListUsers"
      ListUsers();
    }
    break;
    case 50: {
      // "Vote"
      Vote();
    }
    break;
    case 51: {
      // "ToggleExpert"
      ToggleExpert();
    }
    break;
    case 52: {
      // "YourInfo"
      YourInfo();
    }
    break;
    case 53: {
      // "ExpressScan"
      ExpressScan();
    }
    break;
    case 54: {
      // "WWIVVer"
      WWIVVersion();
    }
    break;
    case 55: {
      // "InstanceEdit"
      InstanceEdit();
    }
    break;
    case 56: {
      // "ConferenceEdit"
      JumpEdit();
    }
    break;
    case 57: {
      // "SubEdit"
      BoardEdit();
    }
    break;
    case 58: {
      // "ChainEdit"
      ChainEdit();
    }
    break;
    case 59: {
      // "ToggleAvailable"
      ToggleChat();
    }
    break;
    case 60: {
      // "ChangeUser"
      ChangeUser();
    }
    break;
    case 61: {
      // "CLOUT"
      CallOut();
    }
    break;
    case 62: {
      // "Debug"
      Debug();
    }
    break;
    case 63: {
      // "DirEdit"
      DirEdit();
    }
    break;
    case 65: {
      // "Edit"
      EditText();
    }
    break;
    case 66: {
      // "BulletinEdit"
      EditBulletins();
    }
    break;
    case 67: {
      // "LoadText"
      // LoadText and LoadTextFile are the same, so they are now merged.
      LoadTextFile();
    }
    break;
    case 68: {
      // "ReadAllMail"
      ReadAllMail();
    }
    break;
    case 69: {
      // "Reboot"
      RebootComputer();
    }
    break;
    case 70: {
      // "ReloadMenus"
      ReloadMenus();
    }
    break;
    case 71: {
      // "ResetUserIndex"
      ResetFiles();
    }
    break;
    case 72: {
      // "ResetQScan"
      ResetQscan();
    }
    break;
    case 73: {
      // "MemStat"
      MemoryStatus();
    }
    break;
    case 74: {
      // "PackMsgs"
      PackMessages();
    }
    break;
    case 75: {
      // "VoteEdit"
      InitVotes();
    }
    break;
    case 76: {
      // "Log"
      ReadLog();
    }
    break;
    case 77: {
      // "NetLog"
      ReadNetLog();
    }
    break;
    case 78: {
      // "Pending"
      PrintPending();
    }
    break;
    case 79: {
      // "Status"
      PrintStatus();
    }
    break;
    case 80: {
      // "TextEdit"
      TextEdit();
    }
    break;
    case 81: {
      // "UserEdit"
      UserEdit();
    }
    break;
    case 82: {
      // "VotePrint"
      VotePrint();
    }
    break;
    case 83: {
      // "YLog"
      YesturdaysLog();
    }
    break;
    case 84: {
      // "ZLog"
      ZLog();
    }
    break;
    case 85: {
      // "ViewNetDataLog"
      ViewNetDataLog();
    }
    break;
    case 86: {
      // "UploadPost"
      UploadPost();
    }
    break;
    case 87: {
      // "ClearScreen"
      GetSession()->bout.ClearScreen();
    }
    break;
    case 88: {
      // "NetListing"
      NetListing();
    }
    break;
    case 89: {
      // "WHO"
      WhoIsOnline();
    }
    break;
    case 90: {
      // /A "NewMsgsAllConfs"
      NewMsgsAllConfs();
    }
    break;
    case 91: {
      // /E "MultiEMail"
      MultiEmail();
    }
    break;
    case 92: {
      // "NewMsgScanFromHere"
      NewMsgScanFromHere();
    }
    break;
    case 93: {
      // "ValidatePosts"
      ValidateScan();
    }
    break;
    case 94: {
      // "ChatRoom"
      ChatRoom();
    }
    break;
    case 95: {
      // "DownloadPosts"
      DownloadPosts();
    }
    break;
    case 96: {
      // "DownloadFileList"
      DownloadFileList();
    }
    break;
    case 97: {
      // "ClearQScan"
      ClearQScan();
    }
    break;
    case 98: {
      // "FastGoodBye"
      FastGoodBye();
    }
    break;
    case 99: {
      // "NewFilesAllConfs"
      NewFilesAllConfs();
    }
    break;
    case 100: {
      // "ReadIDZ"
      ReadIDZ();
    }
    break;
    case 101: {
      // "UploadAllDirs"
      UploadAllDirs();
    }
    break;
    case 102: {
      // "UploadCurDir"
      UploadCurDir();
    }
    break;
    case 103: {
      // "RenameFiles"
      RenameFiles();
    }
    break;
    case 104: {
      // "MoveFiles"
      MoveFiles();
    }
    break;
    case 105: {
      // "SortDirs"
      SortDirs();
    }
    break;
    case 106: {
      // "ReverseSortDirs"
      ReverseSort();
    }
    break;
    case 107: {
      // "AllowEdit"
      AllowEdit();
    }
    break;
    case 109: {
      // "UploadFilesBBS"
      UploadFilesBBS();
    }
    break;
    case 110: {
      // "DirList"
      DirList();
    }
    break;
    case 111: {
      // "UpDirConf"
      UpDirConf();
    }
    break;
    case 112: {
      // "UpDir"
      UpDir();
    }
    break;
    case 113: {
      // "DownDirConf"
      DownDirConf();
    }
    break;
    case 114: {
      // "DownDir"
      DownDir();
    }
    break;
    case 115: {
      // "ListUsersDL"
      ListUsersDL();
    }
    break;
    case 116: {
      // "PrintDSZLog"
      PrintDSZLog();
    }
    break;
    case 117: {
      // "PrintDevices"
      PrintDevices();
    }
    break;
    case 118: {
      // "ViewArchive"
      ViewArchive();
    }
    break;
    case 119: {
      // "BatchMenu"
      BatchMenu();
    }
    break;
    case 120: {
      // "Download"
      Download();
    }
    break;
    case 121: {
      // "TempExtract"
      TempExtract();
    }
    break;
    case 122: {
      // "FindDescription"
      FindDescription();
    }
    break;
    case 123: {
      // "ArchiveMenu"
      TemporaryStuff();
    }
    break;
    case 124: {
      // "HopDir"
      HopDir();
    }
    break;
    case 125: {
      // "JumpDirConf"
      JumpDirConf();
    }
    break;
    case 126: {
      // "ListFiles"
      ListFiles();
    }
    break;
    case 127: {
      // "NewFileScan"
      NewFileScan();
    }
    break;
    case 128: {
      // "SetNewFileScanDate"
      SetNewFileScanDate();
    }
    break;
    case 129: {
      // "RemoveFiles"
      RemoveFiles();
    }
    break;
    case 130: {
      // "SearchAllFiles"
      SearchAllFiles();
    }
    break;
    case 131: {
      // "XferDefaults"
      XferDefaults();
    }
    break;
    case 132: {
      // "Upload"
      Upload();
    }
    break;
    case 133: {
      // "YourInfoDL"
      YourInfoDL();
    }
    break;
    case 134: {
      // "UploadToSysop"
      UploadToSysop();
    }
    break;
    case 135: {
      // "ReadAutoMessage"
      ReadAutoMessage();
    }
    break;
    case 136: {
      // "SetNewScanMsg"
      SetNewScanMsg();
    }
    break;
    case 137: {
      // "ReadMessages"
      ReadMessages();
    }
    break;
    /*
    case 138:
    { // "RUN"
    ExecuteBasic(szParam1);
    } break;
    */
    case 139: {
      // "EventEdit"
      EventEdit();
    }
    break;
    case 140: {
      // "LoadTextFile"
      LoadTextFile();
    }
    break;
    case 141: {
      // "GuestApply"
      GuestApply();
    }
    break;
    case 142: {
      // "ConfigFileList"
      ConfigFileList();
    }
    break;
    case 143: {
      // "ListAllColors"
      ListAllColors();
    }
    break;
#ifdef QUESTIONS
    case 144: {
      // "EditQuestions"
      EditQuestions();
    }
    break;
    case 145: {
      // "Questions"
      Questions();
    }
    break;
#endif
    case 146: {
      // "RemoveNotThere"
      RemoveNotThere();
    }
    break;
    case 147: {
      // "AttachFile"
      AttachFile();
    }
    break;
    case 148: {
      // "InternetEmail"
      InternetEmail();
    }
    break;
    case 149: {
      // "UnQScan"
      UnQScan();
    }
    break;
    // ppMenuStringsIndex[150] thru ppMenuStringsIndex[153] not used.....
    case 154: {
      // "Packers"
      Packers();
    }
    break;
    case 155: {
      // Color_Config
      color_config();
    }
    break;
    //------------------------------------------------------------------
    //  ppMenuStringsIndex[156] and [157] are reserved for SDS Systems and systems
    //  that distribute modifications.  DO NOT reuse these strings for
    //  other menu options.
    //------------------------------------------------------------------
    //    case 156:
    //    { // ModAccess
    //        ModsAccess();
    //    } break;
    //    case 157:
    //    { // SDSAccess
    //        SDSAccess();
    //      } break;
    //------------------------------------------------------------------
    case 158: {
      // InitVotes
      InitVotes();
    }
    break;
    case 161: {
      // TurnMCIOn
      TurnMCIOn();
    }
    break;
    case 162: {
      // TurnMCIOff
      TurnMCIOff();
    }
    break;
    default: {
      MenuSysopLog("The following command was not recognized");
      MenuSysopLog(szCmd);
    }
    break;
    }
  }
}