mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(EAGLS): detect non-encrypted archives.
This commit is contained in:
parent
1dfa1482b9
commit
15da067676
@ -107,6 +107,7 @@ namespace GameRes.Formats.Eagls
|
|||||||
if (dir[0].Name.HasExtension ("gr")) // CG archive
|
if (dir[0].Name.HasExtension ("gr")) // CG archive
|
||||||
{
|
{
|
||||||
var rng = DetectEncryptionScheme (file, dir[0]);
|
var rng = DetectEncryptionScheme (file, dir[0]);
|
||||||
|
if (rng != null)
|
||||||
return new EaglsArchive (file, this, dir, new CgEncryption (rng));
|
return new EaglsArchive (file, this, dir, new CgEncryption (rng));
|
||||||
}
|
}
|
||||||
else if (has_scripts)
|
else if (has_scripts)
|
||||||
@ -155,6 +156,8 @@ namespace GameRes.Formats.Eagls
|
|||||||
IRandomGenerator DetectEncryptionScheme (ArcView file, Entry first_entry)
|
IRandomGenerator DetectEncryptionScheme (ArcView file, Entry first_entry)
|
||||||
{
|
{
|
||||||
int signature = (file.View.ReadInt32 (first_entry.Offset) >> 8) & 0xFFFF;
|
int signature = (file.View.ReadInt32 (first_entry.Offset) >> 8) & 0xFFFF;
|
||||||
|
if (0x4D42 == signature) // 'BM'
|
||||||
|
return null;
|
||||||
byte seed = file.View.ReadByte (first_entry.Offset+first_entry.Size-1);
|
byte seed = file.View.ReadByte (first_entry.Offset+first_entry.Size-1);
|
||||||
IRandomGenerator[] rng_list = {
|
IRandomGenerator[] rng_list = {
|
||||||
new LehmerRandomGenerator(),
|
new LehmerRandomGenerator(),
|
||||||
|
Loading…
Reference in New Issue
Block a user