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

CRC somewhere in the file? #32

Open
Tuxie opened this issue Jan 22, 2020 · 1 comment
Open

CRC somewhere in the file? #32

Tuxie opened this issue Jan 22, 2020 · 1 comment

Comments

@Tuxie
Copy link

Tuxie commented Jan 22, 2020

Is a checksum of some kind of the original data stored anywhere inside the .cso file? If not, can it be implemented without breaking existing emulator support? I want to map the files to dat file checksums without having to scan and decompress the whole files. If it means having to recompress them once, that is fine.

@unknownbrackets
Copy link
Owner

unknownbrackets commented Jan 26, 2020

The CSO format understood by most tools doesn't really have space for it:
https://github.com/unknownbrackets/maxcso/blob/master/README_CSO.md#format-version-1

That said, the format could be changed to allow for the CRC to be stored somewhere, which would be useful. Unfortunately, this would require changes to emulators and other tools: because the header size field is unreliable and not always written, tools generally ignore it.

Alternatively, there are two unused bytes. In theory, the header size field (ignored by most tools) could be abused to contain the CRC, and then the unused bytes (also ignored) could be set to specific values to make it unlikely the CRC is actually a header size. This would be hacky at best.

Maybe it could also be put at the end of the file, but I'm not sure if some tools might behave oddly with this.

To note, maxcso has a --crc flag and internal API, which will calculate the CRC without writing a decompressed file. I realize this is not what you're looking for, but just mentioning it in case you were looking at an alternative of decompress + calculate CRC.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants