2014-12-29 23:43:48 +00:00
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using System.Threading.Tasks ;
2014-12-30 20:55:50 +00:00
using System.Drawing ;
2014-12-30 22:39:30 +00:00
using System.Diagnostics ;
2014-12-29 23:43:48 +00:00
namespace Pithos
{
class decode
{
public decode ( ) { }
2014-12-30 22:39:30 +00:00
public string injectVariables ( string text ) {
2014-12-29 23:43:48 +00:00
text = text . Replace ( "$user" , Environment . UserName ) ;
return text ;
}
2015-01-04 22:19:36 +00:00
public bool command ( string text ) {
2014-12-29 23:43:48 +00:00
string [ ] args = text . Substring ( 1 ) . Split ( ' ' ) ; //splits string and removed character
2014-12-30 20:55:50 +00:00
2014-12-30 22:39:30 +00:00
if ( args [ 0 ] = = "lock" ) { //locks the program
2014-12-30 20:55:50 +00:00
Program . MW . display ( "Locking Software..." , Color . Red ) ;
2015-01-10 23:16:14 +00:00
Program . MW . adminMode = false ;
2014-12-30 20:55:50 +00:00
Program . MW . Hide ( ) ;
Program . UL . Show ( ) ;
2015-01-04 22:19:36 +00:00
return true ;
2014-12-30 22:39:30 +00:00
}
else if ( args [ 0 ] = = "hash" ) { //hash things
2015-01-04 22:19:36 +00:00
for ( int i = 1 ; i < args . Length ; i + + ) { Program . MW . display ( "String: " + args [ i ] + " Hash: " + tools . hash ( args [ 0 ] ) , Color . Green ) ; }
return true ;
2014-12-29 23:43:48 +00:00
}
2015-01-04 22:19:36 +00:00
else if ( args [ 0 ] = = "shutdown" ) { Process . Start ( "shutdown /s /t 0" ) ; return true ; } //shutdown computer
2015-01-10 23:16:14 +00:00
else if ( args [ 0 ] = = "echo" ) { Program . MW . display ( args [ 1 ] , Color . LimeGreen ) ; return true ; } //display content
else if ( args [ 0 ] = = "override" & & args [ 1 ] = = "¦" ) { Program . MW . adminMode = true ; Program . MW . display ( "Admin Mode had been enabled." , Color . Orange ) ; return true ; } //activate admin
2015-01-04 22:19:36 +00:00
return false ;
2014-12-29 23:43:48 +00:00
}
}
}