Exemplo n.º 1
0
        private bool InjectRom()
        {
            bool injected = true;

            try
            {
                Cll.Log.WriteLine("Empty \"base\\content\\rom\" folder.");
                Directory.Delete("base\\content\\rom", true);
                Directory.CreateDirectory("base\\content\\rom");

                Cll.Log.WriteLine("Injecting ROM.");
                if (RomN64.ToBigEndian(RomPath, "base\\content\\rom\\U" + Rom.ProductCodeVersion + ".z64"))
                {
                    Cll.Log.WriteLine("CRC16: " + Rom.HashCRC16.ToString("X4"));
                    Cll.Log.WriteLine("In: \"base\\content\\rom\\U" + Rom.ProductCodeVersion + ".z64\"");
                    Cll.Log.WriteLine("Injected ROM.");
                }
                else
                {
                    Cll.Log.WriteLine("ROM not injected, \"RomN64.ToBigEndian\" failed.");
                    injected = false;
                }
            }
            catch
            {
                Cll.Log.WriteLine("Error injecting ROM.");
                injected = false;
            }

            return(injected);
        }
Exemplo n.º 2
0
        private bool InjectRom()
        {
            bool injected = true;

            try
            {
                Cll.Log.WriteLine("Empty \"base\\content\\config\" folder.");
                Directory.Delete("base\\content\\config", true);
                Directory.CreateDirectory("base\\content\\config");

                Cll.Log.WriteLine("Injecting INI data.");
                if (IniIsLoaded)
                {
                    FileStream fs = File.Open("base\\content\\config\\U" + Rom.ProductCodeVersion + ".z64.ini", FileMode.Create);
                    fs.Write(_ini, 0, _ini.Length);
                    fs.Close();
                    Cll.Log.WriteLine("INI injected.");
                }
                else
                {
                    File.Create("base\\content\\config\\U" + Rom.ProductCodeVersion + ".z64.ini").Close();
                    Cll.Log.WriteLine("An empty INI injected.");
                }

                Cll.Log.WriteLine("Empty \"base\\content\\rom\" folder.");
                Directory.Delete("base\\content\\rom", true);
                Directory.CreateDirectory("base\\content\\rom");

                Cll.Log.WriteLine("Injecting ROM.");
                if (RomN64.ToBigEndian(RomPath, "base\\content\\rom\\U" + Rom.ProductCodeVersion + ".z64"))
                {
                    Cll.Log.WriteLine("Injected ROM.");
                }
                else
                {
                    Cll.Log.WriteLine("ROM not injected, \"ToBigEndian\" failed.");
                    injected = false;
                }
            }
            catch
            {
                Cll.Log.WriteLine("Error injecting ROM.");
                injected = false;
            }

            return(injected);
        }