I have nothing to gatekeep, i have nothing special...

This commit is contained in:
yarik0chka
2024-04-28 19:52:44 +05:00
parent d135a93412
commit 054df3b752
12 changed files with 203 additions and 27 deletions

View File

@@ -16,7 +16,8 @@ namespace AssetStudio
private static readonly byte[] zipMagic = { 0x50, 0x4B, 0x03, 0x04 };
private static readonly byte[] zipSpannedMagic = { 0x50, 0x4B, 0x07, 0x08 };
private static readonly byte[] mhy0Magic = { 0x6D, 0x68, 0x79, 0x30 };
private static readonly byte[] blbMagic = { 0x42, 0x6C, 0x62, 0x02 };
private static readonly byte[] blb2Magic = { 0x42, 0x6C, 0x62, 0x02 };
private static readonly byte[] blb3Magic = { 0x42, 0x6C, 0x62, 0x03 };
private static readonly byte[] narakaMagic = { 0x15, 0x1E, 0x1C, 0x0D, 0x0D, 0x23, 0x21 };
private static readonly byte[] gunfireMagic = { 0x7C, 0x6D, 0x79, 0x72, 0x27, 0x7A, 0x73, 0x78, 0x3F };
@@ -86,11 +87,16 @@ namespace AssetStudio
return FileType.MhyFile;
}
Logger.Verbose($"Parsed signature does not match with expected signature {Convert.ToHexString(mhy0Magic)}");
if (blbMagic.SequenceEqual(magic))
if (blb2Magic.SequenceEqual(magic))
{
return FileType.BlbFile;
return FileType.Blb2File;
}
Logger.Verbose($"Parsed signature does not match with expected signature {Convert.ToHexString(mhy0Magic)}");
Logger.Verbose($"Parsed signature does not match with expected signature {Convert.ToHexString(blb2Magic)}");
if (blb3Magic.SequenceEqual(magic))
{
return FileType.Blb3File;
}
Logger.Verbose($"Parsed signature does not match with expected signature {Convert.ToHexString(blb3Magic)}");
magic = ReadBytes(7);
Position = 0;
Logger.Verbose($"Parsed signature is {Convert.ToHexString(magic)}");
@@ -229,7 +235,7 @@ namespace AssetStudio
break;
}
}
if (reader.FileType == FileType.BundleFile && game.Type.IsBlockFile() || reader.FileType == FileType.ENCRFile || reader.FileType == FileType.BlbFile)
if (reader.FileType == FileType.BundleFile && game.Type.IsBlockFile() || reader.FileType == FileType.ENCRFile || reader.FileType == FileType.Blb2File || reader.FileType == FileType.Blb3File)
{
Logger.Verbose("File might have multiple bundles !!");
try