-
Notifications
You must be signed in to change notification settings - Fork 10
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
Issue with loading Union related archives #52
Comments
Hi, thanks I'll look at it. I might just implement a proper parsing routine if I can find documentation :) |
Not for this: ZUNIONUTILS.DLL :) |
This fixes a crash with VDFs generate by Union and potentially other 3rd-party tools.
@Try I've added the exception as requested. You can now catch |
Unfortunately can't. This bug was reported on worldofplayer.ru forum, so don't have the file on my side. |
I see. I'd still like to implement it so I'll keep this issue open :> |
Bump: got the Union.vdf file. |
Thanks, that helps out a lot! I managed to find out, that it's a single entry in the VDF which is causing the problem: The entire archive looks like this:
That being said, there seems to be a lot of entropy in that file. When extracted as-is, all content is just random bytes and no structure can be found. The I assume its some sort of compression or encryption but if it's compression I can't tell the type. I'll have to look into the Btw, I apologize for my absence this past week, I've been ill. |
Welcome back :D
Yes, most likely it's compressed. Yet it's probably not worth it to chaise after compression algorithm - just as long as it's not crashing it's fine. |
Yeah that looks like a custom implementation of There might be mods using these features too since the custom VDF loader is the default.
That I can do. It'll be ugly but I'll just generate a zero-length entry if I detect an out-of-bounds condition. |
Hey @Try, can you confirm this is done? |
Tested today on latest Load fine without Union.vdf, but with Union.vdf, game throws exception upon game loading:
Offended file, that been requested from archive: |
Right, that fails because the VDF is compressed and I don't handle that. Just loading and accessing the files is fine but trying to actually parse data from them (animations in this case) will fail unless the data is properly decompressed beforehand. |
Application side, unfortunately is not aware of where compression been used. Is it possible to pretend, that compressed files are not in archive at all? |
Maybe it would be possible but it would be unreliable. Afaik there is no way of telling if a file is stored as compressed or not so I would have to try loading the file to check whether it's compressed or not. Or I would have to try to detect the file type using binary chunk IDs (for example). If you can't handle the error in a try-catch, I recommend just not loading the VDF at all. |
Yes, that's good solution, that I'm happy with. We probably need an api to test if VDF has compressed files. |
If you need to figure out if the VDF is made for/with Union, you can try checking the version stored in the header ( Implementing a check for compressed files is probably not in scope for phoenix unless it's a really simple check. But it looks like there is no easy way of checking that. |
Just my 2 cents to this matter. The modified dll talks about zipped files, so shouldn't it be possible to get a rather reliable variant by first checking the VDF version and then the file for signatures/magic words/patterns? Very likely a open algorithm was used here and ZIP means Deflate many cases. |
I was thinking about that initially, but I noticed none of the files had an obvious header. I did some more investigating and I did find something the could be considered a header. At offset So it actually seems to be possible to detect this compression, I just didn't see those four bytes being the same everywhere. There is some data before that too but I haven't figured out what it means yet. I'm attaching a ZIP containing the first 50 bytes of all files in |
For now added workaround for OpenGothic: checking vdf header: f22560e1 |
More FYI, rather than actual issues. When OpenGothic load *.vdf from file system, game crashes with exception:
Callstack:
I've added simple try-catch handler to workaround issue, so here is the list of files that are failed to load:
Proposed change:
Can you add new dedicated type of exception, if *.vdf file signature does not match
VDF_SIGNATURE_G*
?Thanks!
The text was updated successfully, but these errors were encountered: