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

Support magic numbers for Danganronpa formats #24

Open
UnderMybrella opened this issue Nov 7, 2019 · 1 comment
Open

Support magic numbers for Danganronpa formats #24

UnderMybrella opened this issue Nov 7, 2019 · 1 comment
Labels
community This issue features the broader community of Danganronpa modding, rather than just Spiral enhancement

Comments

@UnderMybrella
Copy link
Member

UnderMybrella commented Nov 7, 2019

Currently, there are a number of formats that don't have proper methods of identifying them. Formats such as the Pak and Lin formats often find themselves registering false positives on completely unrelated files. In the event of file identification, this presents a problem - is a file actually a pak file, or is it just data that looks like a pak file?

Especially when working with large data sets, our options are limited. Currently, Spiral uses a set of "reasonable" boundaries that files must fit in, that tries to reject bad data. However, this isn't always accurate, and can be a bit slower than desired. Magic numbers allow us to immediately identify that a file is the format in question, whereas the boundaries allow us to guess that a file is probably the format.

Starting with the merge of #23, Spiral will (by default) use these new magic numbers for formats that traditionally didn't have them, using Binary Spiral Templates. This will break compatibility with other tools. Existing tools will need to be updated to support these magic numbers or users will need to use the compatibility extract flag.

For developers: These magic numbers are available here. In most cases, simply peeking at the first four bytes and skipping them if it matches will work.

@UnderMybrella UnderMybrella added enhancement community This issue features the broader community of Danganronpa modding, rather than just Spiral labels Nov 7, 2019
@UnderMybrella UnderMybrella pinned this issue Nov 7, 2019
@UnderMybrella
Copy link
Member Author

Note: developers working with flattened game directories (via FlatPatch or equivalent) will need to either disable this feature or maintain a separate development directory. It is unknown if we will be able to patch the game to load these modified files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community This issue features the broader community of Danganronpa modding, rather than just Spiral enhancement
Projects
None yet
Development

No branches or pull requests

1 participant