-
Notifications
You must be signed in to change notification settings - Fork 2
Allowing users to specify which file properties to list #117
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ mpqcli remove fth.txt wow-patch.mpq | |
| Pretty simple, list files in an MPQ archive. Useful to "pipe" to other tools, such as `grep` (see below for examples). | ||
|
|
||
| ``` | ||
| mpqcli list wow-patch.mpq | ||
| $ mpqcli list wow-patch.mpq | ||
| BM_COKETENT01.BLP | ||
| Blizzard_CraftUI.xml | ||
| CreatureSoundData.dbc | ||
|
|
@@ -188,22 +188,67 @@ realmlist.wtf | |
| Similar to the `ls` command with the `-l` and `-a` options, additional detailed information can be included with the `list` subcommand. The `-a` option includes printing "special" files used in MPQ archives including: `(listfile)`, `(attributes)` and `(signature)`. | ||
|
|
||
| ``` | ||
| mpqcli list -d -a wow-patch.mpq | ||
| 88604 enUS 2006-03-29 02:02:37 BM_COKETENT01.BLP | ||
| 243 enUS 2006-04-04 21:28:14 Blizzard_CraftUI.xml | ||
| 388 enUS 2006-03-29 19:32:46 CreatureSoundData.dbc | ||
| ... | ||
| 184 enUS 2006-04-04 21:28:14 Blizzard_CraftUI.lua | ||
| 44900 enUS 2006-03-29 02:01:02 30ee7bd3959906e358eff01332cf045e.blp | ||
| 68 enUS 2006-04-07 00:58:44 realmlist.wtf | ||
| $ mpqcli list -d -a wow-patch.mpq | ||
| 88604 enUS 2006-03-29 02:02:37 BM_COKETENT01.BLP | ||
| 243 enUS 2006-04-04 21:28:14 Blizzard_CraftUI.xml | ||
| 388 enUS 2006-03-29 19:32:46 CreatureSoundData.dbc | ||
| ... | ||
| 184 enUS 2006-04-04 21:28:14 Blizzard_CraftUI.lua | ||
| 44900 enUS 2006-03-29 02:01:02 30ee7bd3959906e358eff01332cf045e.blp | ||
| 68 enUS 2006-04-07 00:58:44 realmlist.wtf | ||
| ``` | ||
|
|
||
| ### List specific properties | ||
|
|
||
| The `list` subcommand supports listing the following properties: | ||
|
|
||
| - `hash-index` - Index in the hash table where the file entry is. | ||
| - `name-hash1` - The first hash of the file name. | ||
| - `name-hash2` - The second hash of the file name. | ||
| - `name-hash3` - 64-bit Jenkins hash of the file name, used for searching in the HET table. | ||
| - `locale` - Locale info of the file. | ||
| - `file-index` - Index in the file table of the file. | ||
| - `byte-offset` - Offset of the file in the MPQ, relative to the MPQ header. | ||
| - `file-time` - Timestamp of the file. | ||
| - `file-size` - Uncompressed file size of the file, in bytes. | ||
| - `compressed-size` - Compressed file size of the file, in bytes. | ||
| - `encryption-key` - Encryption key for the file. | ||
| - `encryption-key-raw` - Encryption key for the file. | ||
| - `flags` - File flags for the file within MPQ: | ||
| * `i`: File is Imploded (By PKWARE Data Compression Library). | ||
| * `c`: File is Compressed (By any of multiple methods). | ||
| * `e`: File is Encrypted. | ||
| * `2`: File is Encrypted with key v2. | ||
| * `p`: File is a Patch file. | ||
| * `u`: File is stored as a single Unit, rather than split into sectors. | ||
| * `d`: File is a Deletion marker. Used in MPQ patches, indicating that the file no longer exists. | ||
| * `r`: File has Sector CRC checksums for each sector. This is ignored if the file is not compressed or imploded. | ||
| * `s`: Present on STANDARD.SNP\(signature). | ||
| * `x`: File exists; this is reset if the file is deleted. | ||
| * `m`: Mask for a file being compressed. | ||
| * `n`: Use default flags for internal files. | ||
| * `f`: Fix key; This is obsolete. | ||
|
Comment on lines
+218
to
+230
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The flags and descriptions are from here: https://github.com/ladislav-zezula/StormLib/blob/b62de3c83fc146c4e8a05bde15d39e19588c28a4/src/StormLib.h#L220-L238 |
||
|
|
||
| You can use the `-p` or `--property` argument with the `list` subcommand to print the given properties. Many properties can be given, and they will be printed in the order given. | ||
|
|
||
| ``` | ||
| $ mpqcli list -d -a War2Patch.mpq -p hash-index -p locale -p flags | ||
| 3028 enUS iexmn Rez\gluchat.bin | ||
| 8926 enUS iexmn Rez\Gateways.txt | ||
| 9078 enUS iexmn Rez\mltiplay.bin | ||
| 10329 enUS ce2xmnf (listfile) | ||
| 14213 enUS iexmn Rez\mltiplay_ita.bin | ||
| 14472 enUS iexmn Rez\mltiplay_esp.bin | ||
| 15278 enUS iexmn Rez\mltiplay_fra.bin | ||
| 15731 enUS iexmn Rez\mltiplay_deu.bin | ||
| ``` | ||
|
|
||
| ### List all files with an external listfile | ||
|
|
||
| Older MPQ archives do not contain (complete) file paths of their content. By providing an external listfile that lists the content of the MPQ archive, the listed files will have the correct paths. Listfiles can be downloaded on [Ladislav Zezula's site](http://www.zezula.net/en/mpq/download.html). | ||
| Older MPQ archives do not contain (complete) file paths of their content. By using the `-l` or `--listfile` argument, one can provide an external listfile that lists the content of the MPQ archive, so that the listed files will have the correct paths. Listfiles can be downloaded on [Ladislav Zezula's site](http://www.zezula.net/en/mpq/download.html). | ||
|
|
||
| ``` | ||
| mpqcli list -l /path/to/listfile StarDat.mpq | ||
| $ mpqcli list -l /path/to/listfile StarDat.mpq | ||
| ``` | ||
|
|
||
| ### Extract all files from an MPQ archive | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names and descriptions are from here: http://zezula.net/en/mpq/stormlib/sfilegetfileinfo.html