Skip to content
Open
Changes from all 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
6 changes: 4 additions & 2 deletions darkgate/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ def unpack_msi_wrapped_payload(filename: str) -> bytes:
for file in os.listdir(td):
with open(os.path.join(td, file), "rb") as f:
content = f.read()
if AU3_MAGIC_BYTES in content:
logging.info(f"Found AU3 script in file {file} in the MSI package.")
mime_type = magic.from_buffer(content, mime=True)
if "application/vnd.ms-cab-compressed" in mime_type:
logging.info("CAB file wrapped payload detected.")
content = unpack_cab_wrapped_payload(os.path.join(td, file))
return content
except subprocess.CalledProcessError:
logging.error("Unpacking of MSI file failed")
Expand Down