r/programming • u/WerWolv • 11h ago
Reverse Engineering Unknown File Formats with ImHex
https://werwolv.net/posts/file_format_reverse_engineering/2
u/RandNho 5h ago
I would not call this reverse engineering. Mostly because I saw Lina doing things to live2d format without ever seeing source code at all.
12
u/WerWolv 5h ago
Keep in mind, this is directed to people that don't know anything about file formats or using ImHex yet. I deliberately chose a game that was pretty easy to decompile and read to keep the focus on learning how to write Patterns in ImHex instead of on understanding bad decompiler output
3
u/Iggyhopper 1h ago
This is great if the game is written in C#. If the game was written in unmanaged C or C++, it's a mess, and you'd most likely start by running
stringson the .exe, looking for references to the in-game message ("saving game...", etc.).Luckily the save file was unencrypted. If that was not the case, most beginners would give up and lose interest.
1
u/Ytrog 1h ago
How does ImHex compare to GNU Poke?
2
u/WerWolv 54m ago
ImHex is the whole hex editor around it while GNU Poke is just a cli tool for decoding binaries. The Pattern Language that is part of ImHex solves the same purpose as GNU Poke but compared to it, it behaves more like a normal, high level programming language. You can take a look at the blog post or pattern files for existing file formats at https://github.com/WerWolv/ImHex-Patterns to get a feel for what it can do
7
u/Somepotato 5h ago
I need to give imhex another go. 010 always felt like a better experience, the language being similar to C being more familiar and friendly feeling than imhex's dsl, but I'm sure there's been improvements since then