Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions UnityPy/files/BundleFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,11 @@ def decompress_data(
The decompressed data."""
comp_flag = CompressionFlags(flags & ArchiveFlags.CompressionTypeMask)

if self.decryptor is not None and flags & 0x100:
compressed_data = self.decryptor.decrypt_block(compressed_data, index)
if self.decryptor is not None and comp_flag != CompressionFlags.NONE and flags & 0x100:
try:
compressed_data = self.decryptor.decrypt_block(compressed_data, index)
except:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such try-except bypass strategy may conceal potential problems. I think we can remove it.

Btw, it's suggested to rename your PR's title to let it reflect actual works.

compressed_data = compressed_data

if comp_flag in CompressionHelper.DECOMPRESSION_MAP:
return cast(
Expand Down