Ejemplo n.º 1
0
        private static void PreSetup(string gameRoot)
        {
            GameAssembly_Path = Path.Combine(gameRoot, "GameAssembly.dll");

            AssemblyFolder = Path.Combine(gameRoot, "MelonLoader", "Managed");

            MSCORLIB_Path = Path.Combine(AssemblyFolder, "mscorlib.dll");

            BaseFolder = SetupDirectory(Path.Combine(Path.Combine(gameRoot, "MelonLoader"), "AssemblyGenerator"));

            Il2CppDumper.BaseFolder             = SetupDirectory(Path.Combine(BaseFolder, "Il2CppDumper"));
            Il2CppAssemblyUnhollower.BaseFolder = SetupDirectory(Path.Combine(BaseFolder, "Il2CppAssemblyUnhollower"));
            UnityDependencies.BaseFolder        = SetupDirectory(Path.Combine(BaseFolder, "UnityDependencies"));

            localConfigPath = Path.Combine(BaseFolder, "config.json");
            if (File.Exists(localConfigPath))
            {
                localConfig = Decoder.Decode(File.ReadAllText(localConfigPath)).Make <LocalConfig>();
            }
        }
Ejemplo n.º 2
0
        public static LocalConfig Load(string path)
        {
            LocalConfig returnval = new LocalConfig();

            if (File.Exists(path))
            {
                string filestr = File.ReadAllText(path);
                if (!string.IsNullOrEmpty(filestr))
                {
                    var doc = Toml.Parse(filestr);
                    if (doc != null)
                    {
                        var       table   = doc.ToModel();
                        TomlTable MainTbl = (TomlTable)table["AssemblyGenerator"];
                        if (MainTbl != null)
                        {
                            returnval.UnityVersion      = (string)MainTbl["UnityVersion"];
                            returnval.GameAssemblyHash  = (string)MainTbl["GameAssemblyHash"];
                            returnval.DumperVersion     = (string)MainTbl["DumperVersion"];
                            returnval.UnhollowerVersion = (string)MainTbl["UnhollowerVersion"];
                            TomlArray oldfilesarr = (TomlArray)MainTbl["OldFiles"];
                            if (oldfilesarr.Count > 0)
                            {
                                for (int i = 0; i < oldfilesarr.Count; i++)
                                {
                                    string file = (string)oldfilesarr[i];
                                    if (!string.IsNullOrEmpty(file))
                                    {
                                        returnval.OldFiles.Add(file);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(returnval);
        }
Ejemplo n.º 3
0
        private static void PreSetup(string gameRoot)
        {
            GameAssembly_Path = Path.Combine(gameRoot, "GameAssembly.dll");

            AssemblyFolder = Path.Combine(gameRoot, "MelonLoader", "Managed");

            MSCORLIB_Path = Path.Combine(AssemblyFolder, "mscorlib.dll");

            BaseFolder = SetupDirectory(Path.Combine(Path.Combine(Path.Combine(gameRoot, "MelonLoader"), "Dependencies"), "AssemblyGenerator"));

            Il2CppDumper.BaseFolder      = SetupDirectory(Path.Combine(BaseFolder, "Il2CppDumper"));
            Il2CppDumper.OutputDirectory = SetupDirectory(Path.Combine(Il2CppDumper.BaseFolder, "DummyDll"));
            Il2CppDumper.FileName        = "Il2CppDumper.exe";

            Il2CppAssemblyUnhollower.BaseFolder      = SetupDirectory(Path.Combine(BaseFolder, "Il2CppAssemblyUnhollower"));
            Il2CppAssemblyUnhollower.OutputDirectory = SetupDirectory(Path.Combine(Il2CppAssemblyUnhollower.BaseFolder, "Output"));
            Il2CppAssemblyUnhollower.FileName        = "AssemblyUnhollower.exe";

            UnityDependencies.BaseFolder = SetupDirectory(Path.Combine(BaseFolder, "UnityDependencies"));

            localConfigPath = Path.Combine(BaseFolder, "config.cfg");
            localConfig     = LocalConfig.Load(localConfigPath);
        }
Ejemplo n.º 4
0
        private static void PreSetup(string gameRoot)
        {
            System.Net.ServicePointManager.Expect100Continue = true;
            System.Net.ServicePointManager.SecurityProtocol |= (System.Net.SecurityProtocolType) 3072;

            GameAssembly_Path = Path.Combine(gameRoot, "GameAssembly.dll");

            AssemblyFolder = Path.Combine(gameRoot, "MelonLoader", "Managed");

            MSCORLIB_Path = Path.Combine(AssemblyFolder, "mscorlib.dll");

            BaseFolder = SetupDirectory(Path.Combine(Path.Combine(Path.Combine(gameRoot, "MelonLoader"), "Dependencies"), "AssemblyGenerator"));

            Il2CppDumper.BaseFolder             = SetupDirectory(Path.Combine(BaseFolder, "Il2CppDumper"));
            Il2CppAssemblyUnhollower.BaseFolder = SetupDirectory(Path.Combine(BaseFolder, "Il2CppAssemblyUnhollower"));
            UnityDependencies.BaseFolder        = SetupDirectory(Path.Combine(BaseFolder, "UnityDependencies"));

            localConfigPath = Path.Combine(BaseFolder, "config.json");
            if (File.Exists(localConfigPath))
            {
                localConfig = Decoder.Decode(File.ReadAllText(localConfigPath)).Make <LocalConfig>();
            }
        }