예제 #1
0
        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();
        }
예제 #2
0
파일: Validators.cs 프로젝트: Jakz/DICUI
        /// <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!");
            }
        }