public void LoadTest() { #if false bool GENERATE_MINI_ISO = true; #endif Dvd9Xbox360 Dvd9Xbox360; MapStream mapStream; ProxyStreamReadWriteAnalyzer FileStreamAnalyzed; Stream FileStream; #if false if (GENERATE_MINI_ISO) { //var FilePath = @"I:\isos\360\Tales of Vesperia [PAL] [Multi3] [English] [Xbox360].iso"; var FilePath = @"E:\Isos\360\games\Tales of Vesperia [PAL] [Multi3] [English] [Xbox360].iso"; FileStream = File.OpenRead(FilePath); } else #endif { mapStream = MapStream.Unserialize(new MemoryStream(File.OpenRead(Utils.TestInputPath + "/mini_iso.bin").ReadAll())); FileStream = mapStream; } FileStreamAnalyzed = new ProxyStreamReadWriteAnalyzer(FileStream); Dvd9Xbox360 = new Dvd9Xbox360().Load(FileStreamAnalyzed); Assert.AreEqual( "EntryStruct(FullName='/snd/config.bin', Offset=366721, Size=3040, Attributes=File)", Dvd9Xbox360.RootEntry["/snd/config.bin"].ToString() ); var Stream = Dvd9Xbox360.RootEntry["/snd/config.bin"].Open(); var TextReaded = Stream.ReadString(4, Encoding.UTF8); Assert.AreEqual("nusc", TextReaded); #if false if (GENERATE_MINI_ISO) { // Analyze. mapStream = FileStreamAnalyzed.ConvertSpacesToMapStream(FileStreamAnalyzed.ReadUsage.JoinWithThresold(Thresold: 32)); SerializerUtils.SerializeToMemoryStream(mapStream.Serialize).CopyToFile(Utils.TestInputPath + "/mini_iso.bin"); } #endif }
public void LoadVfsTest() { var Stream = MapStream.Unserialize(new MemoryStream(File.OpenRead(Utils.TestInputPath + "/mini_iso.bin").ReadAll())); var Dvd9Xbox360 = new Dvd9Xbox360().Load(Stream); var Vfs = new Dvd9Xbox360FileSystem(Dvd9Xbox360); Assert.AreEqual( "ai.svo,btl.svo,chara.svo,chat.svo,common.svo,cook.svo,effect.svo,item.svo,map.svo,menu.svo,mg.svo,string.svo,UI.svo", Vfs.FindFiles("/", "*.svo").Select(Item => Item.Name).ToStringArray(",") ); using (var ConfigStream = Vfs.OpenFile("/snd/config.bin", FileMode.Open)) { var TextReaded = ConfigStream.ReadString(4, Encoding.UTF8); Assert.AreEqual("nusc", TextReaded); } }
static void Main(string[] args) { //var basename = @"C:\Juegos\fez\Content\Essentials.pak.d\fonts\zuish"; //var basename = @"C:\Juegos\fez\Content\Essentials.pak.d\effects\basicposteffect"; //var basename = @"C:\Juegos\fez\Content\Other.pak.d\background planes\qr_crypt"; //DecodeImage(@"C:\Juegos\fez\Content\Other.pak.d\art objects\menu_cube"); //Environment.Exit(0); //var Path = @"C:\Juegos\fez\Content\"; var Path = @"C:\Juegos\fez\Content\Other.pak.d\art objects"; foreach (var filename in Directory.EnumerateFiles(Path, "*", SearchOption.AllDirectories)) { Console.WriteLine("{0}...", filename); try { DecodeImage(filename); } catch (Exception Exception) { //Console.WriteLine(Exception); } } //BE 5A 00 00 //93 AA 04 00 // 0x5ABE // 0xAA93 /* * var Out = new MemoryStream(); * Lzx.Decompress(Stream, 0x5ABE, Out, 0xAA93); * Console.WriteLine(Out.Length); */ Console.ReadKey(); #if false //var FilePath = @"I:\isos\360\Tales of Vesperia [PAL] [Multi3] [English] [Xbox360].iso"; var FilePath = @"C:\tov\tov_spa.iso"; var Dvd9Xbox360 = new Dvd9Xbox360(); using (var IsoStream = File.Open(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)) { Dvd9Xbox360.Load(IsoStream); using (var map_svo_stream = Dvd9Xbox360.RootEntry["/map.svo"].Open()) { var map_svo = new FPS4(map_svo_stream); map_svo["SCENARIO.DAT"].ReplaceWithFile(@"c:\tov\language\scenario_uk.dat"); } Dvd9Xbox360.RootEntry["/language/scenario_us.dat"].ReplaceWithFile(@"c:\tov\language\scenario_uk.dat"); Dvd9Xbox360.RootEntry["/language/scenario_uk.dat"].ReplaceWithFile(@"c:\tov\language\scenario_uk.dat"); Dvd9Xbox360.RootEntry["/language/string_dic_uk.so"].ReplaceWithFile(@"c:\tov\language\string_dic_uk.so"); Dvd9Xbox360.RootEntry["/UI.svo"].ReplaceWithFile(@"c:\tov\ui.svo"); Dvd9Xbox360.RootEntry["/chat.svo"].ReplaceWithFile(@"c:\tov\chat.svo"); } Console.WriteLine("Done. Press any key to continue."); Console.ReadKey(); return; #if true var TranslateSkits = new TranslateSkits(@"c:\tov\chat.svo.bak", @"c:\tov\chat.svo", @"tov_skits.zip"); //var TranslateSkits = new TranslateSkits(); //TranslateSkits.Backup(); TranslateSkits.Process(); new UpdateFont().Process(@"c:\tov\UI.svo", "FONTTEX10.TXV.mod.png"); /* * Console.WriteLine("Decoding..."); * //var Fps4 = new FPS4(File.Open(@"F:\Isos\360\games\vesperia\UI.svo", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)); * var Fps4 = new FPS4(File.Open(@"J:\games\vesperia\UI.svo", FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite)); * using (var Out = Fps4["FONTTEX10.TXV"].Open()) * { * DXT5.SaveSwizzled(new Bitmap(Image.FromFile("../../../TestInput/FONTTEX10.TXV.mod.png")), Out); * } * Console.WriteLine("Ok"); */ /* * //var Bitmap = DXT5.LoadSwizzled(File.OpenRead("../../../TestInput/FONTTEX05.TXV.mod.TXV"), 2048, 2048); * using (var Out = File.OpenWrite("../../../Lol.txv")) * { * DXT5.SaveSwizzled(new Bitmap(Image.FromFile("../../../TestInput/FONTTEX10.TXV.mod.png")), Out); * } */ //Bitmap.Save("../../../Lol.png"); #else var TranslateSkits = new TranslateSkits(); TranslateSkits.Backup(); TranslateSkits.Process(); /* * var FPS4 = new FPS4(); * FPS4.Load(File.OpenRead(@"J:\games\vesperia\chat.svo")); * * Console.WriteLine(FPS4.Entries["VC980US.DAT"].CompressedStream.Length); * * FPS4.Entries["VC980US.DAT"].CompressedStream.CopyTo( * File.OpenWrite(@"C:\projects\svn.tales-tra.com\csharp\TalesOfVesperiaUtils\TestInput\VC980US.DAT"), * 8 * 1024 * 1024 * ); */ #endif #endif Console.WriteLine("Done. Press any key to continue."); Console.ReadKey(); }
public Dvd9Xbox360FileSystem(Dvd9Xbox360 Dvd9Xbox360) { this.Dvd9Xbox360 = Dvd9Xbox360; }
public Dvd9Xbox360FileSystem(Stream Stream) { this.Dvd9Xbox360 = new Dvd9Xbox360().Load(Stream); }