Bobblox21 Posted January 3 Share Posted January 3 There's this archive made with an open-source game engine called Hatch from Github which uses OpenMania (Sonic Mania mod stuff e.t.c) source code and i can't get to open it using RetroED nor extracting it using RSDK_v5 extracting tools cause it uses the "HATCH" header instead of "RSDK" Sample file: Data.hatch is there a way to decompress these files for dumping the resources like (image, sprites, sound and models e.t.c) cause i found some references here: https://github.com/Axanery/HatchGameEngine https://github.com/Axanery/OpenMania Link to comment Share on other sites More sharing options...
ikskoks Posted January 3 Share Posted January 3 Hi. File format looks like this: // header 5 bytes (char) - signature // "HATCH" 3 bytes - version // 01 00 00 // index 2 bytes (uint16) - file count // for each file 4 bytes (uint32) - filename CRC32 8 bytes (uint64) - file offset 8 bytes (uint64) - file uncompressed size 4 bytes (uint32) - data flag // 2 - encrypted, 0 - not encrypted 8 bytes (uint64) - file compressed size // data // for each file x bytes - file data And here's a script to dump and decompress file data. https://github.com/bartlomiejduda/Tools/blob/master/NEW Tools/Hatch Engine/Hatch_Engine_HATCH_script.bms Unfortunately all files with dataFlag=2 are encrypted. If I understand engine's source code corretly, you need original filenames and original file sizes to properly decrypt data. Here's the algorithm to decrypt: https://github.com/Axanery/HatchGameEngine/blob/master/source/Engine/ResourceTypes/ResourceManager.cpp#L172-L232 You can probably hook the game with Frida to get the filenames. 1 Link to comment Share on other sites More sharing options...
ikskoks Posted January 4 Share Posted January 4 Luckily this "Sonic Galactic" game had debug symbols in "demo 2" release 😄 So it was very easy to create frida hook https://github.com/bartlomiejduda/Tools/blob/master/NEW Tools/Hatch Engine/hatch_engine_frida_script.js And I have 574 filenames already: sonic_galactic_filenames_FINAL.zip 1 Link to comment Share on other sites More sharing options...
ikskoks Posted January 4 Share Posted January 4 It's possible to get some assets after making use of the filenames I shared above: Here's my implementation of the decryption algorithm: https://github.com/bartlomiejduda/ReverseBox/blob/main/reversebox/encryption/encryption_hatch_engine.py I'm also working on a extractor for this game, but I'll share it when it will be more user friendly 😄 Link to comment Share on other sites More sharing options...
ikskoks Posted January 5 Share Posted January 5 Currently 1394 filenames are known 2025-01-05 01:41:02 - __main__ - line 109 - INFO - ####### SUMMARY ####### 2025-01-05 01:41:02 - __main__ - line 112 - INFO - Known filenames: 1394 (61.76%) 2025-01-05 01:41:02 - __main__ - line 113 - INFO - Unknown filenames: 863 (38.24%) 2025-01-05 01:41:02 - __main__ - line 114 - INFO - All filenames: 2257 Full list available here: https://github.com/bartlomiejduda/Tools/blob/master/NEW Tools/Hatch Engine/Hatch Engine Archive Tool/filelists/sonic_galactic_demo2_filenames.txt Link to comment Share on other sites More sharing options...
Solution ikskoks Posted January 5 Solution Share Posted January 5 Extractor for data.hatch archive is available here: https://github.com/bartlomiejduda/Tools/tree/master/NEW Tools/Hatch Engine/Hatch Engine Archive Tool Link to comment Share on other sites More sharing options...
ikskoks Posted January 5 Share Posted January 5 Thanks to anonymous user we have now over 90% of the filenames. 😉 2025-01-05 21:17:54 - __main__ - line 109 - INFO - ####### SUMMARY ####### 2025-01-05 21:17:54 - __main__ - line 112 - INFO - Known filenames: 2039 (90.34%) 2025-01-05 21:17:54 - __main__ - line 113 - INFO - Unknown filenames: 218 (9.66%) 2025-01-05 21:17:54 - __main__ - line 114 - INFO - All filenames: 2257 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now