Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary.bz.WrappedSetupProgram is a cab file #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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