Giana’s Return ZDA: Difference between revisions
Jump to navigation
Jump to search
imported>Ikskoks |
imported>Ikskoks |
||
| (12 intermediate revisions by the same user not shown) | |||
| Line 14: | Line 14: | ||
// little endian | // little endian | ||
// Note: Files are compressed with ZLIB | // Note: Files are compressed with ZLIB and encrypted with XOR. | ||
//header | //header | ||
| Line 31: | Line 31: | ||
num_of_files * | num_of_files * | ||
{ | { | ||
x bytes - file data | x bytes - file data | ||
} | } | ||
</pre> | </pre> | ||
| Line 43: | Line 43: | ||
* Files inside those archives are compressed with ZLIB and encrypted with custom XOR encryption. | * Files inside those archives are compressed with ZLIB and encrypted with custom XOR encryption. | ||
* Key used for encrypting file is original file with \xBB byte added at the beginning. | |||
=== Decryption method === | === Decryption method === | ||
| Line 63: | Line 64: | ||
* [https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/Gianas%20Return/Gianas_Return_ZDA_Tool.py Giana's Return ZDA Tool] | * [https://github.com/bartlomiejduda/Tools/blob/master/NEW%20Tools/Gianas%20Return/Gianas_Return_ZDA_Tool.py Giana's Return ZDA Tool] | ||
* [https://github.com/zigaudrey/ZDA-Reconstruction-Script ZDA-Reconstruction-Script] | |||
* [https://www.dropbox.com/s/le8bnknzxke63wn/unZDA.py?dl=0 unZDA.py] | * [https://www.dropbox.com/s/le8bnknzxke63wn/unZDA.py?dl=0 unZDA.py] | ||
<br/><br> | <br/><br> | ||
| Line 73: | Line 75: | ||
[[Category:Extension_zda | Extension: zda]] | [[Category:Extension_zda | Extension: zda]] | ||
[[Category:BMS_None | BMS: None]] | [[Category:BMS_None | BMS: None]] | ||
[[Category:ZLIB compression]] | |||
[[Category:XOR encryption]] | |||
[[Category:File Format]] | [[Category:File Format]] | ||
Latest revision as of 10:42, 1 April 2023
ZDA
- Game : Giana’s Return
- Format Type : Archive
- Endian Order : Little Endian
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.
- Key used for encrypting file is original file with \xBB byte added at the beginning.
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