Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the pack command produce a predictable image file from the same content source. #101

Open
Aerocatia opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working xdvdfs-core Relating to the xdvdfs core library

Comments

@Aerocatia
Copy link

Currently, running the pack command using a image file as input will produce different image files on subsequent runs, although the image content hash produced with xdvdfs checksum always matches.

Using Halo as an example we get this:
If we have a raw dump that matches the redump databse as Halo - Combat Evolved (USA).iso
the image hash will be b8fda9630d1098cfcb46a59cab7e92031bede480661e7ee9f3a23f99dd711c74

Re-packing it with xdvdfs pack will shrink the image as expected, and you will get this:
Halo - Combat Evolved (USA).xiso.iso 50d6513db22cf50628c984637fcd9d6184b5ae37b5833f3249751cd155869024

However, if you run pack again using this file as input a different file will be produced.
Halo - Combat Evolved (USA).xiso.xiso.iso fc448a6f944161f6bb71a2b1a21b727c5836495973de83e034de11e9cdc8c28c

In all cases the content hash is 1f9e0b64febe43b397b0a9b2bec682f9dac9aac48c10530432141054742cbe7a

Ideally, running pack on an iso more that once will not produce a different file provided the same version of xdvdfs is used and the image generation logic has not changed.

This is useful because ideally we don't want the output file to change if the pack process ends up being run more than once for whatever reason unless something actually changed. (e.g. you might run a script to repack a directory of mixed images)

Comparing the images it seems things end up in a different order. I have not looked into it but perhaps this can be solved by sorting something somewhere?

@antangelo antangelo added bug Something isn't working xdvdfs-core Relating to the xdvdfs core library labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working xdvdfs-core Relating to the xdvdfs core library
Projects
None yet
Development

No branches or pull requests

2 participants