Esempio n. 1
0
int main(int argc, char **argv)
{
    VersionStruct *pVersion = NULL;

    PrintWelcome();

    if(argc < 4)
    {
        PrintUsage(argv[0]);
        return 0;
    }

    for(int i = 0; i < sizeof(Versions) / sizeof(Versions[0]); i++)
    {
        if(!stricmp(argv[3], Versions[i].pName))
        {
            pVersion = &Versions[i];
            break;
        }
    }

    if(pVersion == NULL)
    {
        Error("Invalid version.");
    }

    printf("Attempting to exploit %s:%d, running version %s.\n", argv[1], atoi(argv[2]), pVersion->pName);

    if(Exploit(argv[1], atoi(argv[2]), pVersion))
    {
        printf("Check for your shell on port 4444.\n");
    }

    return 0;
}
int main()
{
	PORT_Init();
	UART_Init(19200);
	while (1)
	{
		PrintWelcome();

		while (1)
		{
			AcceptCommands();
			EvaluateStatus(UPDATE_ONLY_ON_CHANGE);
		}			
	}
	return 0;
}
int main()
{
	Initialize();
	system("CLS");
	PrintWelcome();
	getchar();
	system("CLS");
	for (;;)
	{
		cout << "CURRENTLY IN MAIN MENU" << endl;
		cout << "------------" << endl;
		cout << "1) Customer Management" << endl;
		cout << "2) Pizza Management" << endl;
		cout << "3) Order Management" << endl;
		cout << "4) Enter Direct Database Access:" << endl;
		cout << "5) Quit" << endl;
		cout << "------------" << endl;
		cout << "CHOICE: ";

		string Choice;
		getline(cin, Choice);
		system("CLS");
		switch (Choice[0])
		{
		case '1':
			CustomerManagementMain();
			break;
		case '2':
			PizzaManagementMain();
			break;
		case '3':
			OrderManagementMain();
			break;
		case '4':
			DirectAccess();
			break;
		case '5':
			return 0;
			break;
		default:
			cout << "\n\nERROR: CODE 496X: Invalid Command... Please try again.\n\n\n";
			break;
		}
	}
}
// determine command by header character
void AcceptCommands()
{
	unsigned char Temp = 0;
	
	// wait for command input
	while (!(Temp))
	{
		Temp = UART_Receive();
		EvaluateStatus(UPDATE_ONLY_ON_CHANGE);
	}		

	// process command input by inspecting header character
	if (Temp == '?') 
	{
		EvaluateStatus(FORCE_UPDATE);
	}				
	else if (Temp == '=') 
	{
		ControlRelays(); 
	}		
	else if (Temp == '+') 
	{
		TurnOnRelays(); 
	}		
	else if (Temp == '-') 
	{
		TurnOffRelays(); 
	}		
	else if (Temp == 'v') 
	{
		PrintWelcome(); 
	}		
	else
	{
		// unknown command
		PrintError();
	}
}
Esempio n. 5
0
int _tmain(int argc, _TCHAR* argv[])
{
    PrintWelcome();

    if (!ParseCommandLine(argc, argv))
    {
        PrintUsage();
        return 255;
    }

    // Подключение к файлу образа
    if (g_okHardCommand)
    {
        if (!g_hardimage.Attach(g_sImageFileName))
        {
            wprintf(_T("Failed to open the image file.\n"));
            return 255;
        }
    }
    else
    {
        if (!g_diskimage.Attach(g_sImageFileName))
        {
            wprintf(_T("Failed to open the image file.\n"));
            return 255;
        }
    }

    // Main task
    g_pCommand->commandImpl();

    // Завершение работы с файлом
    g_diskimage.Detach();
    g_hardimage.Detach();

    return 0;
}