예제 #1
0
    def __init__(self, reader: ConstBitStreamWrapper):
        StartPos = reader.bytepos
        DataSize = reader.read_uint32()
        DataVersion = reader.read_uint8()

        ElementCount = reader.read_int32()
        self.FileManifest = [FFileManifest() for _ in range(ElementCount)]

        # Serialise the ManifestMetaVersion::Original version variables.
        if (DataVersion >= EFileManifestListVersion.Original.value):
            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].Filename = reader.read_string()

            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].SymlinkTarget = reader.read_string()

            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].FileHash = reader.read_bytes(20)

            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].FileMetaFlags = reader.read_uint8()

            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].InstallTags = reader.read_array(
                    reader.read_string)

            for idx, _ in enumerate(self.FileManifest):
                self.FileManifest[idx].ChunkParts = self.ReadChunkParts(reader)

        # We must always make sure to seek the archive to the correct end location.
        reader.bytepos = StartPos + DataSize
예제 #2
0
    def __init__(self, reader: ConstBitStreamWrapper):
        # Serialise the data header type values.
        StartPos = reader.bytepos

        DataSize = reader.read_uint32()
        DataVersion = reader.read_uint8()

        # Serialise the ManifestMetaVersion::Original version variables.
        if (DataVersion >= EManifestMetaVersion.Original.value):
            self.FeatureLevelInt = reader.read_uint32()
            # Whether this is a legacy 'nochunks' build.
            self.IsFileData = reader.read_byte() == 1
            # The app id provided at generation.
            self.AppID = reader.read_uint32()
            # The app name string provided at generation.
            self.AppName = reader.read_string()
            # The build version string provided at generation.
            self.BuildVersion = reader.read_string()
            # The file in this manifest designated the application executable of the build.
            self.LaunchExe = reader.read_string()
            # The command line required when launching the application executable.
            self.LaunchCommand = reader.read_string()
            # The set of prerequisite ids for dependencies that this build's prerequisite installer will apply.
            self.PrereqIds = reader.read_array(reader.read_string)
            # A display string for the prerequisite provided at generation.
            self.PrereqName = reader.read_string()
            # The file in this manifest designated the launch executable of the prerequisite installer.
            self.PrereqPath = reader.read_string()
            # The command line required when launching the prerequisite installer.
            self.PrereqArgs = reader.read_string()

        # Serialise the BuildId.
        if (DataVersion >= EManifestMetaVersion.SerialisesBuildId.value):
            self.BuildId = reader.read_string()
        # Otherwise, initialise with backwards compatible default when loading.
        else:
            self.BuildId = 'Not added yet'  # self.GetBackwardsCompatibleBuildId()

        # Chunk Sub Dir
        if (self.FeatureLevelInt < EFeatureLevel.DataFileRenames.value):
            self.ChunkSubDir = 'Chunks'
        elif (self.FeatureLevelInt <
              EFeatureLevel.ChunkCompressionSupport.value):
            self.ChunkSubDir = 'ChunksV2'
        elif (self.FeatureLevelInt <
              EFeatureLevel.VariableSizeChunksWithoutWindowSizeChunkInfo.value
              ):
            self.ChunkSubDir = 'ChunksV3'
        else:
            self.ChunkSubDir = 'ChunksV4'

        # File Sub Dir
        if (self.FeatureLevelInt < EFeatureLevel.DataFileRenames.value):
            self.FileSubDir = 'Files'
        elif (self.FeatureLevelInt <
              EFeatureLevel.StoresChunkDataShaHashes.value):
            self.FileSubDir = 'FilesV2'
        else:
            self.FileSubDir = 'FilesV3'

        # We must always make sure to seek the archive to the correct end location.
        reader.bytepos = StartPos + DataSize