This commit is contained in:
Chenx221 2024-10-19 13:52:38 +08:00
parent a4036e89d6
commit 7a6ffec374

View File

@ -72,8 +72,8 @@ namespace TmrHiroRepack
else else
throw new Exception("Invalid Version"); throw new Exception("Invalid Version");
long offset = 0; //Index区偏移 long offset = 0; //Index区偏移
List<Index> indexs = new(); List<Index> indexs = [];
string[] extensions = { ".ogg", ".grd", ".srp" }; //需要移除的文件后缀因为这是Garbro添加的 string[] extensions = [".ogg", ".grd", ".srp"]; //需要移除的文件后缀因为这是Garbro添加的
foreach (string file in files) foreach (string file in files)
{ {
Index i = new(); Index i = new();
@ -112,9 +112,8 @@ namespace TmrHiroRepack
} }
//准备开写 //准备开写
string outputPath = Path.Combine(Path.GetDirectoryName(folderPath), Path.GetFileName(folderPath) + ".pac"); string outputPath = Path.Combine(Path.GetDirectoryName(folderPath), Path.GetFileName(folderPath) + ".pac");
using (FileStream fs = new(outputPath, FileMode.Create)) using FileStream fs = new(outputPath, FileMode.Create);
using (BinaryWriter bw = new(fs)) using BinaryWriter bw = new(fs);
{
bw.Write(count);//文件数量 bw.Write(count);//文件数量
bw.Write(name_length);//文件名长度 bw.Write(name_length);//文件名长度
bw.Write(data_offset);//Data区偏移 bw.Write(data_offset);//Data区偏移
@ -136,12 +135,9 @@ namespace TmrHiroRepack
} }
foreach (string file in files) foreach (string file in files)
{ {
using (FileStream fs2 = new(file, FileMode.Open)) using FileStream fs2 = new(file, FileMode.Open);
{
fs2.CopyTo(fs); fs2.CopyTo(fs);
} }
}
}
return true; return true;
} }
} }