Esempio n. 1
0
        private static bool HandleCommandLinePatch(string[] args)
        {
            System.Collections.Generic.KeyValuePair <string, string> patchFilepaths = PatcherLib.Utilities.Utilities.GetPatchFilepaths(args, ".eepatch");

            if ((string.IsNullOrEmpty(patchFilepaths.Key)) || (string.IsNullOrEmpty(patchFilepaths.Value)))
            {
                return(false);
            }
            else
            {
                System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));
                //while (!System.Diagnostics.Debugger.IsAttached) System.Threading.Thread.Sleep(100);

                try
                {
                    Context context = Context.US_PSX;

                    DataHelper dataHelper = new DataHelper(context);
                    EntryData  patchData  = PatchHelper.GetEntryDataFromPatchFile(patchFilepaths.Key, dataHelper);

                    if (patchFilepaths.Value.ToLower().Trim().EndsWith(".psv"))
                    {
                        PatchHelper.PatchPsxSaveState(patchData, patchFilepaths.Value, dataHelper);
                    }
                    else
                    {
                        PatchHelper.PatchISO(patchData, patchFilepaths.Value, context, dataHelper);
                    }
                }
                catch (Exception ex)
                {
                    AttachConsole(ATTACH_PARENT_PROCESS);
                    Console.WriteLine("Error: " + ex.Message);
                }

                return(true);
            }
        }
Esempio n. 2
0
 private void SavePatchXML(string filepath)
 {
     SaveFormData();
     PatchHelper.SavePatchXML(_entryData, filepath, _context, _dataHelper);
 }