public bool LoadBase(string path) { if (Directory.Exists("base")) { Directory.Delete("base", true); Cll.Log.WriteLine("Previous base deleted."); } if (IsValidBase(path)) { Cll.Log.WriteLine("The \"" + path + "\" folder contains a valid base."); Useful.DirectoryCopy(path, "base", true); } else if (IsValidEncryptedBase(path)) { Cll.Log.WriteLine("The \"" + path + "\" folder contains a valid encrypted base."); NusContent.Decrypt(path, "base"); } else { Cll.Log.WriteLine("The \"" + path + "\" folder not contains a valid base."); } _base = GetLoadedBase(); return(BaseIsLoaded); }
public bool Inject() { _base = GetLoadedBase(); bool _continue = BaseIsLoaded; if (_continue) { Cll.Log.WriteLine("Base info:"); Cll.Log.WriteLine(_base.ToString()); } else { Cll.Log.WriteLine("The base is not loaded."); } if (_continue) { _continue = InjectImages(); } if (_continue) { _continue = InjectMeta(); } if (_continue) { _continue = InjectRom(); } if (_continue) { if (Encrypt) { Cll.Log.WriteLine("Creating encrypted output."); string inPath = Environment.CurrentDirectory + "\\base"; _continue = NusContent.Encrypt(inPath, OutPath); } else { Cll.Log.WriteLine("Creating unencrypted output."); _continue = Useful.DirectoryCopy("base", OutPath, true); } } if (_continue) { Cll.Log.WriteLine("Injection completed successfully!"); } else { Cll.Log.WriteLine("The injection failed.\nCheck the log file \"" + Cll.Log.Filename + "\"."); } return(_continue); }
public DSInjector() { BasePath = null; ShortName = null; LongName = null; InPath = null; RomPath = null; IconPath = null; BootTvPath = null; BootDrcPath = null; OutPath = null; Encrypt = true; _base = GetLoadedBase(); Rom = null; BootTvImg = new BootImage(); BootDrcImg = new BootImage(); IconImg = new IconImage(); }