Example #1
0
        public void Patch()
        {
            string o = Path.GetFileName(file).Replace(".dll", ".tmod");

            if (!File.Exists(o))
            {
                throw new Exception("未找到相应tmod文件");
            }

            TmodFile tmf = new TmodFile(o);

            using (tmf.Open())
            {
                tmf.ReplacePrimaryAssembly(File.ReadAllBytes(file), false);
            }

            tmf.Save(o.Substring(0, o.Length - 5) + "_Patched.tmod");
        }