Skip to content

Commit

Permalink
Updated UE4.26 pak file fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gildor2 committed Oct 4, 2021
1 parent daa3c14 commit 0f6f4df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Unreal/FileSystem/UnArchivePak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ void FPakEntry::DecodeFrom(const uint8* Data)
Data += sizeof(uint32);

// CompressionBlockSize
if ((Bitfield & 0x3f) == 0x3f)
bool bLegacyCompressionBlockSize = ((Bitfield & 0x3f) != 0x3f);
if (!bLegacyCompressionBlockSize)
{
// UE4.27+
CompressionBlockSize = *(uint32*)Data;
Expand Down Expand Up @@ -249,6 +250,12 @@ void FPakEntry::DecodeFrom(const uint8* Data)
// Adjust CompressionBlockSize for small blocks
if (UncompressedSize < CompressionBlockSize)
{
// UE4.27+ code
CompressionBlockSize = UncompressedSize;
}
else if (bLegacyCompressionBlockSize && UncompressedSize < 65536)
{
// UE4.26 code
CompressionBlockSize = UncompressedSize;
}

Expand Down
Binary file modified umodel
Binary file not shown.
Binary file modified umodel.exe
Binary file not shown.

0 comments on commit 0f6f4df

Please sign in to comment.