Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += UnhandledException;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Settings = LoadSettings();
            if (args.Length > 0 && args[0].EndsWith(".swf"))
            {
                var clientInfo = new FileInfo(Path.GetFullPath(args[0]));
                using (var game = new HGame(clientInfo.FullName))
                {
                    game.Disassemble();
                    game.DisableHostChecks();
                    game.InjectKeyShouter(4001);
                    game.InjectEndPointShouter(4000);
                    game.InjectEndPoint("127.0.0.1", (int)Settings["ConnectionListenPort"]);

                    string moddedClientPath = Path.Combine(clientInfo.DirectoryName, "MOD_" + clientInfo.Name);
                    using (var fileOutput = File.Open(moddedClientPath, FileMode.Create))
                        using (var output = new FlashWriter(fileOutput))
                        {
                            game.Assemble(output, CompressionKind.ZLIB);
                        }
                    MessageBox.Show($"File has been modified/re-assembled successfully at '{moddedClientPath}'.", "Tanji - Alert!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                return;
            }

            Eavesdropper.Certifier = new CertificateManager("Tanji", "Tanji Certificate Authority");
            Eavesdropper.Overrides.AddRange(((string)Settings["ProxyOverrides"]).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

            Application.Run(new MainFrm());
        }
Ejemplo n.º 2
0
        private static void PatchClient(FileInfo clientInfo)
        {
            using (var game = new HGame(clientInfo.FullName))
            {
                game.Disassemble();
                game.DisableHostChecks();
                game.InjectKeyShouter(4001);
                game.InjectEndPointShouter(4000);
                game.InjectEndPoint("127.0.0.1", (int)Settings["ConnectionListenPort"]);

                string moddedClientPath = Path.Combine(clientInfo.DirectoryName, "MOD_" + clientInfo.Name);
                using (var fileOutput = File.Open(moddedClientPath, FileMode.Create))
                    using (var output = new FlashWriter(fileOutput))
                    {
                        game.Assemble(output, CompressionKind.ZLIB);
                    }
                MessageBox.Show($"File has been modified/re-assembled successfully at '{moddedClientPath}'.", "Tanji - Alert!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }