mirror of
https://github.com/AdmiralCurtiss/WfcPatcher.git
synced 2026-04-21 01:47:24 -05:00
parent
f90c4491c2
commit
f1e728a2dd
|
|
@ -89,7 +89,7 @@ namespace WfcPatcher {
|
|||
|
||||
nds.Position = nds.Position - 8;
|
||||
uint compressedSize = nds.ReadUInt24();
|
||||
nds.ReadByte();
|
||||
byte headerLength = (byte)nds.ReadByte();
|
||||
uint additionalCompressedSize = nds.ReadUInt32();
|
||||
uint decompressedSize = additionalCompressedSize + len;
|
||||
|
||||
|
|
@ -106,8 +106,10 @@ namespace WfcPatcher {
|
|||
#endif
|
||||
|
||||
blz blz = new blz();
|
||||
// if this condition isn't true then it can't be blz-compressed so don't even try
|
||||
if ( data.Length == compressedSize + 0x4000 || data.Length == compressedSize + 0x4004 ) {
|
||||
// if one of these isn't true then it can't be blz-compressed so don't even try
|
||||
bool headerLengthValid = ( headerLength >= 8 && headerLength <= 11 );
|
||||
bool compressedSizeValid = ( data.Length >= compressedSize + 0x4000 && data.Length <= compressedSize + 0x400B );
|
||||
if ( headerLengthValid && compressedSizeValid ) {
|
||||
try {
|
||||
blz.arm9 = 1;
|
||||
byte[] maybeDecData = blz.BLZ_Decode( data );
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user