Example #1
0
        internal void ApplyPatch(ref byte[] Rom, string PatchPath)
        {
            var    CurrentDirectory = Directory.GetCurrentDirectory();
            string assemblyPath     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            Directory.SetCurrentDirectory(Path.Combine(assemblyPath, "patches"));

            var ThePatch = BpsPatch.Load(PatchPath);

            ThePatch.Apply(ref Rom);

            Directory.SetCurrentDirectory(CurrentDirectory);
        }
Example #2
0
        public static BpsPatch Load(string FileName)
        {
            if (!File.Exists(FileName))
            {
                return(null);
            }

            var ThePatch = new BpsPatch();

            if (ThePatch.Process(File.ReadAllBytes(FileName)))
            {
                return(ThePatch);
            }

            return(null);
        }