Skip to content

Comments

Adding option to provide listfiles to the 'extract' and 'list' commmands#31

Merged
thomaslaurenson merged 1 commit intoTheGrayDot:mainfrom
sjoblomj:main
Mar 26, 2025
Merged

Adding option to provide listfiles to the 'extract' and 'list' commmands#31
thomaslaurenson merged 1 commit intoTheGrayDot:mainfrom
sjoblomj:main

Conversation

@sjoblomj
Copy link
Contributor

@sjoblomj sjoblomj commented Mar 8, 2025

The MPQ file format don't contain the file names of the files in the archives. By convention, the file names tend to be listed in the file (listfile), but in older MPQs (from StarCraft I, WarCraft II BNE, Diablo I, etc) that file is missing or incomplete.

By providing an external listfile, the user can list or extract files under their correct file paths.

This PR works by setting the szListFile argument of the SFileFindFirstFile function to the path given by the user.

@thomaslaurenson thomaslaurenson self-requested a review March 13, 2025 04:35
@thomaslaurenson
Copy link
Collaborator

This looks great - thanks for the PR. Will do a test and check functionality, but looks good from looking at the code.

Copy link
Collaborator

@thomaslaurenson thomaslaurenson left a comment

Choose a reason for hiding this comment

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

Review - and changes look good. I have tested and working as expected.

Took a while to test because I couldn't find an MPQ without a (listfile). Cannot create an MPQ using Ladik's MPQ Editor because the (listfile) is mandatory - and cannot delete the file after creation. Instead, leveraged SFileCreateArchive2 which uses CreateInfo where you can exclude MPQ_CREATE_LISTFILE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants