hetelek / Velocity

A cross-platform application built using the Qt framework that allows you to browse and edit Xbox 360 files.
GNU General Public License v3.0
155 stars 48 forks source link

Backup Hashtables are never updated #66

Open K4r0qtuYNE5G4qgZ opened 9 years ago

K4r0qtuYNE5G4qgZ commented 9 years ago

Only the active Hashtables are read/written too, the Backup Hashtables are never updated, so they are empty and therefore invalid.

This affects all Levels and also causes a secondary arbitrary Hashtable Change to Top Level on both Hashtables on Levels above Zero, which makes all secondary Hashtables invalid automatically, because Values in the active Table must be xored by 0x40 to be valid on the secondary above Level Zero Hashtables.

The same Value on both means it will reference the same which is invalid, they must be inverted to be valid, so if it is a Top Table and the active contains 0 there must be a 0x40 or a 0xC0 on the secondary to reference the correct one.

Currently it only works for the active one because of the arbitrary Change to Top Table, because a 0x00 then and only then is valid for the active Table, but this also means its automatically invalid for all secondary Tables.

This Issue makes Packages created with Velocity incompatible with STFS and such Packages will most likely immediately corrupt on the first Change made to them.

For Compatiblity the secondary Hashtables must also be updated correctly, i also strongly suppose that removing the arbitrary Top Table Change will also be a prerequisite to fix this Issue.