-
September 28, 2010, 11:01 AM
#1
Improved Python pack extractor
Maybe this is old news, but nobody ever told me, so here it goes.
Some time ago I found somebody's Python-based .pack extractor that I used for its CLI convenience, but it seems to only work until patch.pack correctly, and failed with newer ones. It turns out .pack files contain extra stuff in headers.
Full .pack header description is:
- uint32 magic "PFH0"
- uint32 pack type (boot 0, main 1, patch 2, mod 3, movie 4)
- uint32 dependencies count
- uint32 dependencies header size
- uint32 files count
- uint32 files header size
Dependencies were (0, 0) for all packs until patch.pack, so confusion is understandable.
As far as I can tell loading order is based on:
- mod type
- explicit dependencies in headers
- modification time (but even if modification time of patch2.pack is newer than patch4.pack, it will never be reversed)
- usual randomness
This makes far more sense now.
Individual entries in dependencies subheader are null-terminated C strings.
Individual entries in file subheader are (uint32 data size, null-terminated C string)
Data for file_5 starts at:
- 24 + dep_header_len + files_header_len + file_size_0 + ... + file_size_4
The formula is easier than old extractor had it, header size is plainly stated, so we don't need to bother calculating it on fly.
It's all Python and for CLI use. Casual Windows users are advised to keep using GUI-based pack extractor.
By the way shouldn't submods list explicit dependencies on their main mods in headers the same way how patch3.pack lists explicit dependence on patch2.pack and so on?
My experience of last week says that ETW was originally written as fully moddable game - probably a lot more moddable than RTW/M2TW (yes, laugh at me), and then some executive meeting about DLC happened and some asshats decided to hide all modding parts behind a wall of obscurity just to ensure better DLC sales or for similar stupid reason.
Now I'm not against purchasing actual games, but people buying DLC with a unit or a map are part of the problem - such things would be freely available from modding community if it wasn't for DLC sellers putting artificial obstacles in our way! All corporations are smart enough to count game sales and DLC sales as separate categories, so by not buying DLC of things that should be trivial to mod you can prove them wrong, and decrease their future influence.
-
October 01, 2010, 09:25 AM
#2
Re: Improved Python pack extractor
The last bit you said regarding ETW WAS moddable is just gold.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules