理论上支持ESC-ARC1重新封包
未测试,手头上没有老版本
This commit is contained in:
parent
6505ac4862
commit
d3abca73ad
@ -177,6 +177,25 @@ namespace EscudeTools
|
||||
bw.Write(m_seed);
|
||||
m_count = (uint)pItem.Count;
|
||||
bw.Write(m_count ^ NextKey());
|
||||
EncodingProvider provider = CodePagesEncodingProvider.Instance;
|
||||
Encoding? shiftJis = provider.GetEncoding("shift-jis");
|
||||
if (version == 1) //未经测试
|
||||
{
|
||||
long storeOffset = 0x10 + m_count * 0x88;
|
||||
for (int i = 0; i < m_count; i++)
|
||||
{
|
||||
byte[] strbytes = shiftJis.GetBytes(pItem[i].Name);
|
||||
byte[] result = new byte[80];
|
||||
int lengthToCopy = Math.Min(strbytes.Length, 78);
|
||||
Array.Copy(strbytes, result, lengthToCopy);
|
||||
bw.Write(result);
|
||||
bw.Write(storeOffset);
|
||||
bw.Write(pItem[i].Size);
|
||||
storeOffset += pItem[i].Size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint namesSize = (uint)pItem.Sum(e => e.Name.Length + 1);
|
||||
bw.Write(namesSize ^ NextKey());
|
||||
uint filenameOffset = 0;
|
||||
@ -196,14 +215,14 @@ namespace EscudeTools
|
||||
}
|
||||
Decrypt(ref index);
|
||||
bw.Write(index);
|
||||
EncodingProvider provider = CodePagesEncodingProvider.Instance;
|
||||
Encoding? shiftJis = provider.GetEncoding("shift-jis");
|
||||
|
||||
foreach (Entry entry in pItem)
|
||||
{
|
||||
byte[] nameBytes = shiftJis.GetBytes(entry.Name);
|
||||
bw.Write(nameBytes);
|
||||
bw.Write((byte)0);
|
||||
}
|
||||
}
|
||||
foreach (Entry entry in pItem)
|
||||
{
|
||||
byte[] data = File.ReadAllBytes(Path.Combine(path, entry.Name));
|
||||
|
Loading…
Reference in New Issue
Block a user