Beispiel #1
0
        static void Main()
        {
            try
            {
                Decompyler.VerifySetup();
                BuildInfo.Update(BuildInfo.SelectByHighestBuild(true));
                byte[] codePackage;
                int    codeBuild = BuildInfo.ClientBuild;
                if (BuildInfo.CodePackageURL == null)
                {
                    Console.WriteLine("[-] no client patch is available, fallback to clients code.ccp");
                    var path = Path.Combine(Settings.Default.EVEPath, "code.ccp");
                    if (!File.Exists(path))
                    {
                        Console.WriteLine("[-] failure: you have no code.ccp or your EVE path is wrong");
                        Console.WriteLine("[-] aborting");
                        return;
                    }
                    try
                    {
                        var common = File.ReadAllLines(Settings.Default.EVEPath + "/common.ini");
                        foreach (var line in common)
                        {
                            if (line.StartsWith("build="))
                            {
                                codeBuild = int.Parse(line.Substring(6));
                                Console.WriteLine("[-] (your client is on build " + codeBuild + ")");
                                break;
                            }
                        }
                    }
                    catch (Exception)
                    {
                        Console.WriteLine("[-] failed to read build from EVE common.ini, using server info: " + codeBuild);
                    }
                    codePackage = File.ReadAllBytes(Path.Combine(Settings.Default.EVEPath, "code.ccp"));
                }
                else
                {
                    codePackage = BuildInfo.DownloadCode(true);
                }

                Console.WriteLine("[+] initializing cryptographic backend");
                Crypto.Initialize();
                Console.WriteLine("[+] loading compyled code into repository");
                var repo = new Repository();
                ImportLibrary(repo);
                repo.Import(new CodeZip("code", new MemoryStream(codePackage)));
                repo.Decompyle(codeBuild + "\\", true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("[-] Exception: " + ex);
                Console.ReadLine();
            }
        }
Beispiel #2
0
        public void Decompyle(string outputDir, bool verbose = false)
        {
            if (verbose)
            {
                Console.WriteLine("[+] cleaning up the output directory..");
            }
            if (Directory.Exists(outputDir))
            {
                Directory.Delete(outputDir, true);
            }

            if (verbose)
            {
                Console.WriteLine("[+] decompyling " + Files.Count + " files in repository");
            }
            int i = 0;

            foreach (var file in Files)
            {
                if (verbose)
                {
                    Console.Write("[+] decompyling " + Path.GetFileNameWithoutExtension(file.Path) + ".. ");
                }
                var sw = new Stopwatch();
                sw.Start();
                var data = Decompyler.Decompyle(file.Data, file.MissingHeader);
                sw.Stop();
                if (data == null)
                {
                    if (verbose)
                    {
                        Console.WriteLine("failed");
                    }
                }
                else
                {
                    if (verbose)
                    {
                        Console.WriteLine(sw.ElapsedMilliseconds + "ms");
                    }
                    var outPath = outputDir + file.Path;
                    Directory.CreateDirectory(Path.GetDirectoryName(outPath));
                    File.WriteAllText(outPath, data);
                }
                i++;
                if (verbose && i % 10 == 0)
                {
                    Console.WriteLine("[+] processed " + i + "/" + Files.Count + " = " + Math.Round((i / (double)Files.Count) * 100) + "%");
                }
            }
        }