UnrealPak 的加密参数

UnrealPak 支持的命令行参数:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
LogPakFile: Display: Using command line for crypto configuration
LogPakFile: Error: No pak file name specified. Usage:
LogPakFile: Error: UnrealPak <PakFilename> -Test
LogPakFile: Error: UnrealPak <PakFilename> -List [-ExcludeDeleted]
LogPakFile: Error: UnrealPak <PakFilename> <GameUProjectName> <GameFolderName> -ExportDependencies=<OutputFileBase> -NoAssetRegistryCache -ForceDependsGathering
LogPakFile: Error: UnrealPak <PakFilename> -Extract <ExtractDir> [-Filter=<filename>]
LogPakFile: Error: UnrealPak <PakFilename> -Create=<ResponseFile> [Options]
LogPakFile: Error: UnrealPak <PakFilename> -Dest=<MountPoint>
LogPakFile: Error: UnrealPak <PakFilename> -Repack [-Output=Path] [-ExcludeDeleted] [Options]
LogPakFile: Error: UnrealPak <PakFilename1> <PakFilename2> -diff
LogPakFile: Error: UnrealPak <PakFolder> -AuditFiles [-OnlyDeleted] [-CSV=<filename>] [-order=<OrderingFile>] [-SortByOrdering]
LogPakFile: Error: UnrealPak <PakFilename> -WhatsAtOffset [offset1] [offset2] [offset3] [...]
LogPakFile: Error: UnrealPak <PakFolder> -GeneratePIXMappingFile -OutputPath=<Path>
LogPakFile: Error: Options:
LogPakFile: Error: -blocksize=<BlockSize>
LogPakFile: Error: -bitwindow=<BitWindow>
LogPakFile: Error: -compress
LogPakFile: Error: -encrypt
LogPakFile: Error: -order=<OrderingFile>
LogPakFile: Error: -diff (requires 2 filenames first)
LogPakFile: Error: -enginedir (specify engine dir for when using ini encryption configs)
LogPakFile: Error: -projectdir (specify project dir for when using ini encryption configs)
LogPakFile: Error: -encryptionini (specify ini base name to gather encryption settings from)
LogPakFile: Error: -extracttomountpoint (Extract to mount point path of pak file)
LogPakFile: Error: -encryptindex (encrypt the pak file index, making it unusable in unrealpak without supplying the key)
LogPakFile: Error: -compressionformat[s]=<Format[,format2,...]> (set the format(s) to compress with, falling back on failures)
LogPakFile: Error: -encryptionkeyoverrideguid (override the encryption key guid used for encrypting data in this pak file)
LogPakFile: Error: -sign (generate a signature (.sig) file alongside the pak)
LogPakFile: Error: -fallbackOrderForNonUassetFiles (if order is not specified for ubulk/uexp files, figure out implicit order based on the uasset order. Generally applies only to the cooker order)
LogPakFile: Display: Unreal pak executed in 0.006367 seconds

关于包的加密,在 Project Settings-Crypto 中有四个选项:

  • bEnablePakIndexEncryption: 加密 Pakindex
  • bEnablePakIniEncryption:加密 pak 中的 ini
  • bEnablePakUAssetEncryption:加密 pak 中的 uasset
  • bEnablePakFullAssetEncryption:加密 Pak 中所有的文件

但是除了 bEnablePakIndexEncryption 之外,其他的参数并不是传递给 UnrealPak 的命令行参数,而是生成的 Paklist 中每个文件的参数:

对 paklist 中的对应格式文件添加 -encrypt 参数。

1
2
3
4
5
"C:\Users\lipengzha\Documents\UnrealProjects\Blank425\Saved\Cooked\WindowsNoEditor\Engine\Content\EngineResources\GradientTexture0.uasset" "../../../Engine/Content/EngineResources/GradientTexture0.uasset" -encrypt
"C:\Users\lipengzha\Documents\UnrealProjects\Blank425\Saved\Cooked\WindowsNoEditor\Engine\Content\EngineResources\GradientTexture0.uexp" "../../../Engine/Content/EngineResources/GradientTexture0.uexp" -encrypt
"C:\Users\lipengzha\Documents\UnrealProjects\Blank425\Saved\Temp\Win64\Engine\Config\Base.ini" "../../../Engine/Config/Base.ini" -encrypt
"C:\Users\lipengzha\Documents\UnrealProjects\Blank425\Saved\Temp\Win64\Engine\Config\BaseCompat.ini" "../../../Engine/Config/BaseCompat.ini" -encrypt
"C:\Users\lipengzha\Documents\UnrealProjects\Blank425\Intermediate\Staging\Blank425.upluginmanifest" "../../../Blank425/Plugins/Blank425.upluginmanifest" -encrypt

当开启了 bEnablePakIniEncryption,就会对当前 Paklist 中的 ini 文件添加-encrypt 参数。