Example #1
0
        public static void GoExt(string path)
        {
            for (char ch = 'a'; ch <= 'z'; ch++)
            {
                Thread t = new Thread(() =>
                {
                    Decrypt inst  = new Decrypt(path, PrepareForExt(ch, ch));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                });

                t.Priority = ThreadPriority.Highest;

                threads.Add(t);

                t.Start();

                Console.WriteLine(string.Format("Process for RANGE({0} - {1}) started", ch, ch));
            }
        }
Example #2
0
        public static void GoStd(string path)
        {
            for (int i = 0; i < 10; ++i)
            {
                int LowerBound = i * 100;
                int UpperBound = (i + 1) * 100 - 1;

                Thread t = new Thread(() =>
                {
                    Decrypt inst  = new Decrypt(path, PrepareForStd(LowerBound, UpperBound));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                });

                t.Priority = ThreadPriority.Highest;

                threads.Add(t);

                t.Start();

                Console.WriteLine(string.Format("Process for RANGE({0} - {1}) started", LowerBound, UpperBound));
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            foreach (var arg in args)
            {
                Console.Write(arg + " ");
            }
            Console.WriteLine();

            if (args.Length == 4)
            {
                switch (args[0].ToLower())
                {
                case "std":
                {
                    int LowerBound = int.Parse(args[2]);
                    int UpperBound = int.Parse(args[3]);

                    Decrypt inst = new Decrypt(args[1], PrepareForStd(LowerBound, UpperBound));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                }
                break;

                case "ext":
                {
                    int LowerBound = (int)char.Parse(args[2]);
                    int UpperBound = (int)char.Parse(args[3]);

                    Decrypt inst = new Decrypt(args[1], PrepareForExt(LowerBound, UpperBound));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                }
                break;
                }
            }
            else if (args.Length == 3)
            {
                if (args[0] == "dict")
                {
                    string path    = args[1];
                    string dicfile = args[2];

                    try
                    {
                        using (StreamReader sr = new StreamReader(dicfile))
                        {
                            List <string> pswList = new List <string>();
                            for (; !sr.EndOfStream;)
                            {
                                pswList.Add(sr.ReadLine());
                            }

                            Decrypt inst = new Decrypt(path, pswList);
                            inst.Matched += Inst_Matched;
                            inst.Run();
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            else
            {
                string path = string.Empty;

                for (; ;)
                {
                    Console.Write("path:");
                    path = Console.ReadLine();

                    if (path == "" || path.Trim() == "")
                    {
                        continue;
                    }

                    if (!path.Contains(".7z"))
                    {
                        continue;
                    }

                    if (path.Contains(".7z."))
                    {
                        FileInfo tempInfo = new FileInfo(path);

                        var newPath = path.Replace(tempInfo.Extension, "");

                        if (!File.Exists(newPath))
                        {
                            string cmdStr = string.Format("cd {0}\ncopy /y /b \"{1}.00*\" \"{2}\"",
                                                          tempInfo.DirectoryName,
                                                          newPath,
                                                          newPath);

                            RunCmd(cmdStr);
                        }

                        path = newPath;
                    }

                    break;
                }

                for (; ;)
                {
                    Console.Write("std(1) or ext(0):");
                    string read = Console.ReadLine();

                    if (read == "1")
                    {
                        GoStd(path);
                        break;
                    }
                    else if (read == "0")
                    {
                        GoExt(path);
                        break;
                    }
                }

                for (; threads.Any(m => m.IsAlive);)
                {
                }
            }

            Console.WriteLine("#finished");

            return;
        }
Example #4
0
        static void Main(string[] args)
        {
            foreach(var arg in args)
                Console.Write(arg+" ");
            Console.WriteLine();

            if (args.Length  == 4)
            {
                switch(args[0].ToLower())
                {
                    case "std":
                        {
                            int LowerBound = int.Parse(args[2]);
                            int UpperBound = int.Parse(args[3]);

                            Decrypt inst = new Decrypt(args[1], PrepareForStd(LowerBound,UpperBound));
                            inst.Matched += Inst_Matched;
                            inst.Run();
                        }
                        break;
                    case "ext":
                        {
                            int LowerBound = (int)char.Parse(args[2]);
                            int UpperBound = (int)char.Parse(args[3]);

                            Decrypt inst = new Decrypt(args[1], PrepareForExt(LowerBound,UpperBound));
                            inst.Matched += Inst_Matched;
                            inst.Run();
                        }
                        break;
                }

            }
            else if(args.Length == 3)
            {
                if (args[0] == "dict")
                {
                    string path = args[1];
                    string dicfile = args[2];

                    try
                    {
                        using (StreamReader sr = new StreamReader(dicfile))
                        {
                            List<string> pswList = new List<string>();
                            for (; !sr.EndOfStream; )
                            {
                                pswList.Add(sr.ReadLine());
                            }

                            Decrypt inst = new Decrypt(path, pswList);
                            inst.Matched += Inst_Matched;
                            inst.Run();
                        }
                    }
                    catch (Exception ex)
                    {

                    }
                }
            }
            else
            {
                string path = string.Empty;

                for (; ; )
                {
                    Console.Write("path:");
                    path = Console.ReadLine();

                    if (path == "" || path.Trim() == "")
                        continue;

                    if (!path.Contains(".7z"))
                        continue;

                    if (path.Contains(".7z."))
                    {
                        FileInfo tempInfo = new FileInfo(path);

                        var newPath = path.Replace(tempInfo.Extension, "");

                        if (!File.Exists(newPath))
                        {
                            string cmdStr = string.Format("cd {0}\ncopy /y /b \"{1}.00*\" \"{2}\"",
                                tempInfo.DirectoryName,
                                newPath,
                                newPath);

                            RunCmd(cmdStr);
                        }

                        path = newPath;
                    }

                    break;
                }

                for (; ; )
                {
                    Console.Write("std(1) or ext(0):");
                    string read = Console.ReadLine();

                    if (read == "1")
                    {
                        GoStd(path);
                        break;
                    }
                    else if (read == "0")
                    {
                        GoExt(path);
                        break;
                    }
                }

                for(;threads.Any(m=>m.IsAlive);)
                {
                }
            }

            Console.WriteLine("#finished");

            return;
        }
Example #5
0
        public static void GoStd(string path)
        {
            for (int i = 0; i < 10; ++i)
            {
                int LowerBound = i * 100;
                int UpperBound = (i + 1) * 100 - 1;

                Thread t = new Thread(() =>
                {
                    Decrypt inst = new Decrypt(path, PrepareForStd(LowerBound, UpperBound));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                });

                t.Priority = ThreadPriority.Highest;

                threads.Add(t);

                t.Start();

                Console.WriteLine(string.Format("Process for RANGE({0} - {1}) started", LowerBound, UpperBound));
            }
        }
Example #6
0
        public static void GoExt(string path)
        {
            for (char ch = 'a'; ch <= 'z'; ch++)
            {
                Thread t = new Thread(() =>
                {
                    Decrypt inst = new Decrypt(path, PrepareForExt(ch, ch));
                    inst.Matched += Inst_Matched;
                    inst.Run();
                });

                t.Priority = ThreadPriority.Highest;

                threads.Add(t);

                t.Start();

                Console.WriteLine(string.Format("Process for RANGE({0} - {1}) started", ch, ch));
            }
        }