public void TestMdf() { var resPath = Path.Combine(Environment.CurrentDirectory, @"..\..\Res"); var path = Path.Combine(resPath, "e-mote38_free.mmo"); //var path = Path.Combine(resPath, "e-mote38_free.mmo-repack.mmo"); var path2 = Path.Combine(resPath, "emote38-pure.mmo"); MdfFile.CompressPsbToMdfStream(File.OpenRead(path2)).CopyTo(File.Create(path + "-repack.mmo")); using (var mdfStream = File.OpenRead(path)) { using (var psbStream = MdfFile.DecompressToPsbStream(mdfStream)) { //using (var pureStream = new MemoryStream((int)psbStream.Length)) { //PsbFile.Encode(key, EncodeMode.Decrypt, EncodePosition.Auto, psbStream, pureStream); PSB psb = new PSB(psbStream); psb.SaveAsMdfFile(path + "-build.mmo"); } } } }