mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(ACV): rely on base class.
This commit is contained in:
parent
34fce4538a
commit
0661f12b6b
@ -23,12 +23,7 @@
|
|||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
using System.IO;
|
|
||||||
using GameRes.Compression;
|
|
||||||
using GameRes.Utility;
|
|
||||||
|
|
||||||
namespace GameRes.Formats.NonColor
|
namespace GameRes.Formats.NonColor
|
||||||
{
|
{
|
||||||
@ -65,29 +60,8 @@ namespace GameRes.Formats.NonColor
|
|||||||
var dir = index.Read (file_map);
|
var dir = index.Read (file_map);
|
||||||
if (null == dir)
|
if (null == dir)
|
||||||
return null;
|
return null;
|
||||||
if (is_script)
|
return new ArcDatArchive (file, this, dir, scheme.Hash);
|
||||||
{
|
|
||||||
foreach (ArcDatEntry entry in dir)
|
|
||||||
entry.Hash ^= scheme.Hash;
|
|
||||||
}
|
|
||||||
return new ArcFile (file, this, dir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
|
||||||
{
|
|
||||||
var dent = entry as ArcDatEntry;
|
|
||||||
if (null == dent || 0 == dent.Size)
|
|
||||||
return arc.File.CreateStream (entry.Offset, entry.Size);
|
|
||||||
var data = arc.File.View.ReadBytes (entry.Offset, entry.Size);
|
|
||||||
if (dent.IsPacked)
|
|
||||||
{
|
|
||||||
DecryptData (data, (uint)dent.Hash);
|
|
||||||
return new ZLibStream (new MemoryStream (data), CompressionMode.Decompress);
|
|
||||||
}
|
|
||||||
if (dent.RawName != null && 0 != dent.Flags)
|
|
||||||
DecryptWithName (data, dent.RawName);
|
|
||||||
return new BinMemoryStream (data, entry.Name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user