Here goes my nubish code
PHP Code:
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
using std::cout;
using std::cin;
char command;
int ch;
char ip;
// Inpute Function. checks all input.
void inpute()
{
cprintf ( ">> \n" );
cprintf ( ">> " );
cin >> command;
cprintf ( ">> \n" );
cprintf ( ">> \n" );
if (command == '0')
{
cprintf ( ">> 1 - Formats specified hard drive\n" );
cprintf ( ">> -- syntax = 1 [Drive Letter]\n" );
cprintf ( ">> 2 - Pings specified IP Address\n" );
cprintf ( ">> -- syntax = 2 [IP Address]\n" );
cprintf ( ">> 3 - Exits Blade Command 0.1\n" );
cprintf ( ">> -- syntax = 3\n" );
cprintf ( ">> 4 - Starts Putty\n" );
cprintf ( ">> -- syntax = 4\n" );
cprintf ( ">> 5 - Clears Console\n" );
cprintf ( ">> -- syntax = 5\n" );
inpute();
} else {
if (command == '1')
{
cprintf ( ">> 1 - Formats specified hard drive\n" );
cprintf ( ">> Currently not availible\n" );
inpute();
} else {
if (command == '2')
{
cprintf ( ">> 2 - Ping specified IP Address\n" );
cprintf ( ">> IP: ");
cin >> ip;
cprintf ( ">> \n" );
inpute();
} else {
if (command == '3')
{
cprintf ( ">> 3 - Exits Blade Command 0.1\n" );
system("PAUSE");
} else {
if (command == '4')
{
cprintf ( ">> 4 - Starts Putty\n" );
cprintf ( ">> Putty Started\n" );
system ("C:/putty.exe");
cprintf ( ">> Putty Ended\n" );
inpute();
} else {
if (command == '5')
{
system ("cls");
inpute();
}
}
}
}
}
}
}
// Login Function
void login()
{
int pass;
cprintf ( ">> \n" );
cprintf ( ">> == Authorization Required! ==\n" );
cprintf ( ">> Enter numerical pass: " );
cin >> pass;
cprintf ( ">> \n" );
if (pass == 123)
{
cprintf ( ">> Granted!\n" );
cprintf ( ">> Please Enter a command, or type '0' for a list of commands!\n" );
inpute();
} else {
cprintf ( ">> == Invalid Password! ==\a\n" );
cprintf ( ">> \n" );
login();
}
}
Thats before I added all the stuff
Now After
PHP Code:
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
using std::cout;
using std::cin;
char command;
int ch;
char ip;
// Inpute Function. checks all input.
void inpute()
{
cprintf ( ">> \n" );
cprintf ( ">> " );
cin >> command;
cprintf ( ">> \n" );
cprintf ( ">> \n" );
if (command == '0')
{
cprintf ( ">> 1 - Formats specified hard drive\n" );
cprintf ( ">> -- syntax = 1 [Drive Letter]\n" );
cprintf ( ">> 2 - Pings specified IP Address\n" );
cprintf ( ">> -- syntax = 2 [IP Address]\n" );
cprintf ( ">> 3 - Exits Blade Command 0.1\n" );
cprintf ( ">> -- syntax = 3\n" );
cprintf ( ">> 4 - Starts Putty\n" );
cprintf ( ">> -- syntax = 4\n" );
cprintf ( ">> 5 - Clears Console\n" );
cprintf ( ">> -- syntax = 5\n" );
inpute();
} else {
if (command == '1')
{
cprintf ( ">> 1 - Formats specified hard drive\n" );
cprintf ( ">> Currently not availible\n" );
inpute();
} else {
if (command == '2')
{
string commands;
string ip;
cprintf ( ">> 2 - Pings specified IP Address\n" );
cprintf ( ">> IP: ");
cin >> ip;
commands = "ping " + ip;
system( commands.c_str() );
cprintf ( ">> \n" );
inpute();
} else {
if (command == '3')
{
cprintf ( ">> 3 - Exits Blade Command 0.1\n" );
system("PAUSE");
} else {
if (command == '4')
{
cprintf ( ">> 4 - Starts Putty\n" );
cprintf ( ">> Putty Started\n" );
system ("C:/putty.exe");
cprintf ( ">> Putty Ended\n" );
inpute();
} else {
if (command == '5')
{
system ("cls");
inpute();
}
}
}
}
}
}
}
// Login Function
void login()
{
int pass;
cprintf ( ">> \n" );
cprintf ( ">> == Authorization Required! ==\n" );
cprintf ( ">> Enter numerical pass: " );
cin >> pass;
cprintf ( ">> \n" );
if (pass == 123)
{
cprintf ( ">> Granted!\n" );
cprintf ( ">> Please Enter a command, or type '0' for a list of commands!\n" );
inpute();
} else {
cprintf ( ">> == Invalid Password! ==\a\n" );
cprintf ( ">> \n" );
login();
}
}