Vindictus HFS: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
imported>Dinoguy1000 (rv - no, let's not switch out download links for random MediaFire downloads) |
||
| Line 84: | Line 84: | ||
* Not supported | * Not supported | ||
=== Programs | === Supported by Programs === | ||
* VZipFlip | * VZipFlip http://dl.dropbox.com/u/759758/VZipFlip5.zip | ||
Revision as of 05:05, 18 April 2011
Back to index | Edit this page
HFS
- Format type: Archive
- Endianness: Little-endian
Format Specifications (ZIP-like)
// for each local file header
- char {4} - Signature (HF) (0x02014648)
- uint16 {2} - Version needed to extract (seen as 20)
- uint16 {2} - General purpose bit flag
- uint16 {2} - Compression method (always 'Stored')
- uint16 {2} - Last mod file time
- uint16 {2} - Last mod file date
- uint32 {4} - CRC32
- uint32 {4} - Compressed File Size
- uint32 {4} - Decompressed File Size
- uint16 {2} - Filename Length
- uint16 {2} - Extra Field Length
- char {X} - Filename (Obfuscated)
- char {X} - Extra field
- byte {X} - File Data (Obfuscated, Compressed)
// for each central directory header
- char {4} - Signature (HF) (0x02014648)
- uint16 {2} - Version created with (seen as 20)
- uint16 {2} - Version needed to extract (seen as 20)
- uint16 {2} - General purpose bit flag
- uint16 {2} - Compression method (always 'Stored')
- uint16 {2} - Last mod file time
- uint16 {2} - Last mod file date
- uint32 {4} - CRC32
- uint32 {4} - Compressed File Size
- uint32 {4} - Decompressed File Size
- uint16 {2} - Filename Length
- uint16 {2} - Extra Field Length
- uint16 {2} - Comment Length
- uint16 {2} - Disk number
- uint16 {2} - Internal attributes
- uint32 {4} - External attributes
- uint32 {4} - Relative offset of local file header
- char {X} - Filename (Obfuscated)
- char {X} - Extra field
- char {X} - comment
// end of central directory
- char {4} - Signature (HF) (0x06054648)
- uint16 {2} - Number of disk
- uint16 {2} - Disk where CD starts
- uint16 {2} - Number of CD records
- uint16 {2} - Count of CD records
- uint32 {4} - Size of central directory
- uint32 {4} - offset to start of CD
- uint16 {2} - Zip comment length
- char {X} - comment
- uint32 {4} - Second-pass Checksum (Optional, changes handling)
Obfuscation
- The base cipher is the "Xor Cipher" as described:
public static void XorBlockWithKey(byte[] buffer, byte[] key, int src_position)
{
Debug.Assert(key.Length == 4 || key.Length == 4096);
for (int x = 0; x < buffer.Length; x++)
{
buffer[x] ^= key[(src_position + x) & (key.Length - 1)];
}
}
- All archives are obfuscated with atleast one pass of the Xor cipher, with the source position as the file position of the block. The file names and data in the Local File Header, and the file name in the Central Directory Header are obfuscated.
- The key is constant, but encrypted in game files, available in the tool "VZipFlip" as XorTruths.bin
- If the Second-pass checksum in the End of Central Directory Header exists, then a second pass of the Xor Cipher is performed with the 32-bit key: EndOfCentralDirectory.CentralDirectorySize * EndOfCentralDirectory.OffsetOfCentralDirectory.
Notes and Comments
- The game is also called "Mabinogi Heroes"
- The game should be considered Episode 1 of the Source engine as far as file formats used.
- It is not known how the Second-pass checksum is created, or what the value is. The most likely candidate is CRC-32, perhaps XORed with a key.
- The file name of the HFS is likely a 160-bit hash, likely SHA-1, perhaps of the path.
- Some files have the extension ".comp". The file data will have a "COMP" header. The data is compressed with DEFLATE (RFC 1951).
MultiEx BMS Script
- Not supported