static void Main(string[] args) { var p = new Progress <FileProtection>(); p.ProgressChanged += Changed; foreach (string arg in args) { Console.WriteLine(String.Join("\r\n", ProtectionFind.Scan(arg, p).Select(kvp => kvp.Key + ": " + kvp.Value))); } Console.ReadLine(); }
/// <summary> /// Run protection scan on a given dump environment /// </summary> /// <param name="env">DumpEnvirionment containing all required information</param> /// <returns>Copy protection detected in the envirionment, if any</returns> public static async Task <string> RunProtectionScanOnPath(string path) { try { var found = await Task.Run(() => { return(ProtectionFind.Scan(path)); }); if (found == null || found.Count == 0) { return("None found"); } return(string.Join("\n", found.Select(kvp => kvp.Key + ": " + kvp.Value).ToArray())); } catch { return("Disc could not be scanned!"); } }