Difference between revisions of "ZiPatch File Structure"
Line 1: | Line 1: | ||
− | All ZiPatch files for FINAL FANTASY XIV share the same overall structure. This format was later expanded in 2012 for DRAGON QUEST X and FINAL FANTASY XIV: A Realm Reborn, which are more similar in their DAT structure. Many of the | + | All ZiPatch files for FINAL FANTASY XIV share the same overall structure. This format was later expanded in 2012 for DRAGON QUEST X and FINAL FANTASY XIV: A Realm Reborn, which are more similar in their DAT structure. Many of the block types found in this version were deprecated, but still remain in the executable for A Realm Reborn. |
ZiPatch File Header | ZiPatch File Header | ||
<code>91 5A 49 50 41 54 43 48 0D 0A 1A 0A</code> | <code>91 5A 49 50 41 54 43 48 0D 0A 1A 0A</code> | ||
− | + | The ZiPatch File Header is followed immediately by n blocks, which carry specific instructions. Each block has the following structure: | |
− | |||
− | |||
− | crc is standard CRC32 checksum (RFC 1952) of | + | <pre> |
+ | [StructLayout(LayoutKind.Sequential, Pack=4)] | ||
+ | struct Block | ||
+ | { | ||
+ | int dataSize; // Little Endian | ||
+ | byte[] data; // data.Length is dataSize + 4 (inclusive of block type identifier) | ||
+ | [MarshalAs(UnmanagedType.ByValArray, SizeConst=4)] | ||
+ | byte[] crc; // crc is a standard CRC32 checksum (RFC 1952) of data | ||
+ | } | ||
+ | </pre> | ||
byte type[data[0..3]] | byte type[data[0..3]] |
Revision as of 18:38, 5 June 2019
All ZiPatch files for FINAL FANTASY XIV share the same overall structure. This format was later expanded in 2012 for DRAGON QUEST X and FINAL FANTASY XIV: A Realm Reborn, which are more similar in their DAT structure. Many of the block types found in this version were deprecated, but still remain in the executable for A Realm Reborn.
ZiPatch File Header
91 5A 49 50 41 54 43 48 0D 0A 1A 0A
The ZiPatch File Header is followed immediately by n blocks, which carry specific instructions. Each block has the following structure:
[StructLayout(LayoutKind.Sequential, Pack=4)] struct Block { int dataSize; // Little Endian byte[] data; // data.Length is dataSize + 4 (inclusive of block type identifier) [MarshalAs(UnmanagedType.ByValArray, SizeConst=4)] byte[] crc; // crc is a standard CRC32 checksum (RFC 1952) of data }
byte type[data[0..3]] "FHDR" (File Header) "APLY" "APFS" "ETRY" (Entry File) "ADIR" (Add Directory) "DELD" (Delete Directory)
>>FHDR byte version[4] byte result[4] uint numEtry (Little Endian) uint numAply (Little Endian) uint numDeld (Little Endian)
>>ADIR uint pathSize (Little Endian) byte path[pathSize]
>>DELD uint pathSize (Little Endian) byte path[pathSize]