Giana’s Return ZDA

From XentaxWiki
Revision as of 15:21, 4 April 2021 by Ikskoks (talk | contribs) (Compatible Programs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ZDA


Format Specifications

// Giana's Return
// ZDA file format

// little endian

// Note: Files are compressed with ZLIB and encrypted with XOR.

//header
4 bytes (char) - magic // "ZDA\x00"
4 bytes (uint32) - number of files
4 bytes (uint32) - data start offset

num_of_files *
{
   40 bytes (char) - filename + padding
   4 bytes (uint32) - uncompressed size
   4 bytes (uint32) - compressed size
   4 bytes (uint32) - relative file offset
}

num_of_files *
{
   x bytes - file data  
}

MultiEx BMS Script

Not written yet.

Notes and Comments

  • Files inside those archives are compressed with ZLIB and encrypted with custom XOR encryption.

Decryption method

Implementation for decryption method written in Python:

def decrypt_data(in_data):
    xor_res = b'\xBB'
    data_size = len(in_data)
    out_data = bytearray()
    
    for curr_offset in range(data_size):
        data_byte = struct.pack("B", in_data[curr_offset])
        xor_res = xore(xor_res, data_byte)
        out_data.extend(xor_res)
    
    return out_data

Compatible Programs