private void checker_Tick(object sender, EventArgs e) { this.Enabled = false; // Check that loki is still running if (Loki.isDone()) { // No need for heartbeats heartbeat.Enabled = false; // Submit Loki Scan Results to the platform string loki_results = Loki.getResults(); PlatformConnector.submitResults(loki_results); // Remove Loki files Loki.removeLoki(); // Remove LokiXAgent and Exit application PlatformConnector.deleteYourself(); } else { // Check again after 1 minute this.Enabled = true; } }
private void Form1_Load(object sender, EventArgs e) { checker.Enabled = false; heartbeat.Enabled = false; // Init Platform IP PlatformConnector.initPlatformIp(); // Register scan and get an API token bool gotToken = PlatformConnector.initScan(); if (gotToken) { // Start the Heartbeat Timer (every 5 minutes interval) heartbeat.Enabled = true; // Initlizse Loki Loki.initLoki(Path.GetTempPath() + "lokix"); // Download the Loki Zip file + Extract its contents Loki.getLoki(); // Start Loki Sweep Loki.execute(); // Start the Loki Execution Cheaker timer (every 1 minute interval) checker.Enabled = true; } }