Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Sonic Galactic (Demo 2) .hatch file

Featured Replies

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
image.thumb.png.a56e4e8cde776486bf42a6545700efb5.png
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


 

Solved by ikskoks

  • Supporter

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.

  • Supporter

It's possible to get some assets after making use of the filenames I shared above:
obraz.png.efee47fb47400852fda5bc9b7829f68c.png

 

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 😄 

  • Supporter

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

  • Supporter

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

 

  • 2 weeks later...

Can you get the .hsl files?

exemple

Stage/2_CGZ/Enemies/Crab/CGZCrabCutscene2Spawn.hsl
Stage/2_CGZ/Enemies/Crab/CrabBoss.hsl
Stage/2_CGZ/Enemies/Crab/CrabDespawner.hsl
Stage/2_CGZ/Enemies/Crab/CrabDestroyRect.hsl

 

Edited by Kubatao

  • Supporter

Tool I shared above can decrypt and extract ALL files from the archive, but some filenames are still unknown, so you'll get names like "file123.bin" instead of "CrabBoss.hsl"
You could search for them in "Unknown_Files" directory.

I don't know how to use this tool, can you share everything you manage to extract?

 

  • 6 months later...
On 1/4/2025 at 8:02 PM, ikskoks said:

It's possible to get some assets after making use of the filenames I shared above:
obraz.png.efee47fb47400852fda5bc9b7829f68c.png

 

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 😄 

I couldn't find any of the files over here, any luck or on how I can extract them?

  • Supporter
1 hour ago, KrisAnimations said:

I couldn't find any of the files over here, any luck or on how I can extract them?

Hi. You just have to use tool I shared in one of the previous post
https://github.com/bartlomiejduda/Tools/tree/master/NEW Tools/Hatch Engine/Hatch Engine Archive Tool

 

It's a Python program, so you need to follow these steps:
1. Install Python 3.11 https://www.python.org/downloads/release/python-3119/

2. Install all requirements using pip
 

pip install -r requirements.txt

3. Run the tool as explained in readme file.

It doesn't find the file Data.hatch doesn't exists for me
I cannot find the file SonicGalactic\Data.hatch and
it says

"aster\\Tools-master\\hatch_engine_archive_tool.py': [Errno 2] No such file or directory
PS C:\Users\depre\Downloads\Tools-master\Tools-master>" if I try to locate it with shift and right click to the python cmd
but
the logs says
"2025-07-27 23:50:29 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:50:29 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:50:35 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:50:35 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:51:56 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:51:56 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:52:01 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:52:01 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!"

Edited by KrisAnimations

19 minutes ago, ikskoks said:

You need to put valid paths for the tool to work. Also if you have any spaces in your paths, you have to put double quotes around them.

I did copied what was putted I am unsure if there are spaces..
the app hatch engine archive tool is closing itself when open

 

Edited by KrisAnimations

9 minutes ago, ikskoks said:

Please read or watch some tutorials on how to run command line programs https://www.google.com/search?q=how+to+run+command+line+program

or how to run python scripts with arguments https://www.google.com/search?q=how+to+run+python+script+with+arguments


It is a simple python script. Running this in cmd is pretty standard action.

8 hours ago, ikskoks said:

Hi. You just have to use tool I shared in one of the previous post
https://github.com/bartlomiejduda/Tools/tree/master/NEW Tools/Hatch Engine/Hatch Engine Archive Tool

 

It's a Python program, so you need to follow these steps:
1. Install Python 3.11 https://www.python.org/downloads/release/python-3119/

2. Install all requirements using pip
 

pip install -r requirements.txt

3. Run the tool as explained in readme file.

The tool requires a valid .hatch file (e.g., Data.hatch), and that file is missing.
The error is not about spaces or command line formatting it’s simply that the file doesn’t exist of what I downloaded from the links ya send
The script expects Data.hatch but it’s not included in the demo download. Where can I get that file or what file am I supposed to use as input to -e?

This is the only way forward, unless the .hatch file is packed under another name ?

and the hatch_engine_archive_tool is closing when opened as I showed the logs it says
"2025-07-27 23:50:29 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:50:29 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:50:35 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:50:35 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:51:56 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:51:56 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!
2025-07-27 23:52:01 - __main__ - line 34 - INFO - Starting export data...
2025-07-27 23:52:01 - reversebox.io_files.file_handler - line 114 - ERROR - Can't read from this file!"

this simply when the file is opened

Edited by KrisAnimations

  • Supporter

WHAT 😄 So why did you even ask in the thread about hatch file if you don't have hatch file? 😄😄 

This topic is about Sonic Galactic, so you have to download Sonic Galactic first to even see the hatch file, I thought it was abvious.

Here is the link --> 
https://sonicgalactic.github.io/download.html

You need to download the game and hatch file will be located in the archive. Just unpack it wherever you like😄 

obraz.png.7d6de504eba57b50c839137d5e0c8f57.png

I literally don't know how to help more with this...

4 minutes ago, ikskoks said:

WHAT 😄 So why did you even ask in the thread about hatch file if you don't have hatch file? 😄😄 

This topic is about Sonic Galactic, so you have to download Sonic Galactic first to even see the hatch file, I thought it was abvious.

Here is the link --> 
https://sonicgalactic.github.io/download.html

You need to download the game and hatch file will be located in the archive. Just unpack it wherever you like😄 

obraz.png.7d6de504eba57b50c839137d5e0c8f57.png

I literally don't know how to help more with this...

😄😄 that's on me then I am sorry hahaha
however I still cannot open the hatch files that's the issue?image.png.18e73be6a62fd5a1eb3c9d8efad75786.png

Edited by KrisAnimations

11 minutes ago, ikskoks said:

WHAT 😄 So why did you even ask in the thread about hatch file if you don't have hatch file? 😄😄 

This topic is about Sonic Galactic, so you have to download Sonic Galactic first to even see the hatch file, I thought it was abvious.

Here is the link --> 
https://sonicgalactic.github.io/download.html

You need to download the game and hatch file will be located in the archive. Just unpack it wherever you like😄 

obraz.png.7d6de504eba57b50c839137d5e0c8f57.png

I literally don't know how to help more with this...

I did it ! never mind thank you so much ! everything is extracting 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.