Skip to content

PyPack has hardcoded assumptions about Python 2.2 & 2.3 #305

@dpogue

Description

@dpogue

When PyPack extracts files from a .pak, it needs to add the Python version magic to each file. It has an enum of supported Python versions:

enum PycHeader
{
kPyc22 = 0x0A0DED2D,
kPyc23 = 0x0A0DF23B,
};

It makes the decision about whether to use the 2.2 version number or the 2.3 version number based on the encryption type used by the .pak file:

S.writeInt((eType == plEncryptedStream::kEncXtea || eType == plEncryptedStream::kEncNone)
? kPyc22 : kPyc23);

This will fail to use the right Python magic code for H'uru MOULa clients that use Python 3.10 or 3.12 (and historically 2.7).

Since there's nothing in the pak file to indicate the Python version, maybe the best choice is to add an option to specify a Python version and fall back to the existing logic if the option is unspecified?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions