back
134 comments
The hash is merely a CRC32; exactly this one (polynomial 0x77073096, code is wrong)

https://web.mit.edu/freebsd/head/sys/libkern/crc32.c

(The decoded ints in the post are the constants in this CRC32).

Knowing it's a CRC32 and knowing the polynomial allows inverting the answers in log time instead of exponential time by exploiting the modular math of the polynomial rings.

I know some of these words!
Thanks! I didn't clock that - should have looked at the decrypted values!
Binwalk claims to recognize crc polynomial tables i wonder if it could find this one.

Also someone needs to integrate binwalk & ghidra, they synergize too much.

Do you have any tips on knowing how the value is a result of CRC32 and/or the polynomial/initial value used?
When the original Ecco came out on the Megadrive (Genesis), I spent all my hard-earned money to buy it. That game is obscenely hard. I got frustrated, so I sat down for the afternoon with a pen and paper and somehow managed to decode the password system. I teleported to the final level and completed it the next day.

Then I was wracked with guilt about spending all my money on a game I completed in two days.

> I sat down for the afternoon with a pen and paper and somehow managed to decode the password system

Would love to hear more about this, if you have any recollection :)

Philosophically, I would argue that you did not complete the game.

You skipped several levels and saw only some percentage of the intended content, gameplay, story, etc. Games in general, and Ecco the Dolphin is no exception, are very much about the journey and not just the destination. You missed out on themes & experiences like isolation, making friends with those outside of your in-group, conservation, time travel, communing with dinosaurs and, of course, space travel.

So, you really shouldn't have felt so guilty.

What a final level, though! Having skipped a large chunk of the game, were you surprised by it?
You must be the only Person in the world that Beat this Game, cheating or otherwise.
QQRIQ is a phonetic abbreviation of "kukuriku", which is the sound of the rooster in Hungarian and in several other languages (Polish "kukuryku", Hebrew " קוקוריקו" etc.). Makes wonder what the process for choosing the passwords was.
Also Gyugyu might be a reference to the Hungarian movie: "The Fifth Seal"

"Just imagine you are about to die, but you will be reincarnated in to one of two people; a slave or the rich master. The slave suffers under the master. He has his tongue and an eye removed and his wife and child are killed. He goes on living knowing he is a good person, as he never committed such appalling, sadistic acts on another like his master has done. The rich master has no moral qualms about it at all. He doesn't think what he did was wrong; the slave needed to be punished. You have the choice, whether to be a poor and righteous slave or be a rich and corrupt master."

Gyugyu is the name of the slave.

https://www.imdb.com/title/tt0075467

The programmers for this game were in Budapest, so this is a good guess!
Popely with a Hungarian "ly" was a giveaway too
Cocorico in french, very close :)
See also: the town of Kakariko in Zelda which always has chickens
could it be that the rooster/cockadoodledoo is something performed like clockwork in the morning, so the showing framedata also being tangential to time and clocks ? probably not
an interesting aside: when asked about his inspirations Ecco's developer Ed Annunziata said, "No, I never took LSD, but I did read a lot from John C. Lilly". Lilly is known for his pioneering work in the fields of animal intelligence, ketamine psychotherapy, isolation tanks, and consciousness exploration.

The name "Ecco" is a reference to Lilly's ECCO (Earth Coincidence Control Office), a supernatural/extraterrestrial base which John posited existed on the other side of the moon to coordinate all earthly "coincidences". He was also one of the first to recognize how intelligent dolphins were and became obsessed with figuring out how to communicate with them, going as far as flooding half of his house in the Carribeans to cohabitate. This is just the tip of the iceberg. I'd highly recommend his autobiography The Center of the Cyclone if any of this is intriguing, he's a fascinating guy

Great read!

Do you have any resources on getting started with Dreamcast game reverse engineering? I've been wanting to do some things with Skies of Arcadia, and I've been hoping there exist techniques more systematic than "see what values change between memory snapshots".

> I've been hoping there exist techniques more systematic than "see what values change between memory snapshots".

FWIW this is pretty much the standard method for locating value locations in RAM. It actually works pretty well. Some emulators have tools built in for that, like Dolphin for example. Even old game hacking tools like the Gameshark for N64 used the technique, with an on-console UI. I don't know if any Dreamcast emulators have tools for it or not.

I wrote about the technique in Dolphin here (and the followup article is also about console game hacking with Ghidra): https://www.smokingonabike.com/2021/01/17/hacking-super-monk...

I've poked around a bit with that game! The main trick is to import the memory snapshot (various ways of dumping it to a file; people like Cheat Engine for this) into Ghidra.

Ghidra can analyze the SuperH processor machine code natively, so the auto analysis will turn up lots of functions.

I've taken to older games a lot more in recent years, they feel like they have a lot more soul if that makes any sense. Also sorry about your car! Not going to leave it idling in the driveway anymore, thanks for the warning.
Are you sure you don't miss modern features like mandatory network connectivity and micro transactions?
What happened to their car? I didn't see anything about that in the post or comments.
I always wondered where to start learning reverse-engineering. Most people will say learn Assembly first. But from there on, there seems to be not much more concrete information online.

Do people just figured it out by trial & error like common patterns in x86 / arm / arcade platforms slowly?

I can't really find much discussion on details online.

It's like debugging.. I'm sure you must have worked on an unfamiliar code base at some point and had to figure it out. Instead of having the source you have the binary and using tools like Ghidra you can start to piece together the source but you'll still need to reason over it the very same way you did on that unfamiliar codebase and this time there's no comments at all ( which isn't uncommon in a lot of source available projects mind you )

So you're probably already half way there. Being familiar with assembly code helps of course.

run through http://microcorruption.com or https://crackmes.one/ for closer to real-life examples
I personally learned a lot by messing in Cheat Engine, it is way more capable than I thought, specially because I mostly used it as a kid and never looked back.

It is a great tool to get started with assembly in my opinion because the disassembler is good enough and you can write what they call 'assembly scripts' which provides the foundation on doing memory patches in x86 asm. Then from that you can start writing your own utils to patch the games at your own will.

You can do crazy cheats by patching the game just with Cheat Engine!

I knew some from school, but stepping through a debugger with a video game that I remembered from childhood was a better education on computer engineering than anything I got in class.
I'd love to see footage of the underwater soccer cheat in action.
Nice! Interesting how similar games seem to do this, checksumming to fixed integers. Pitfall: The Lost Expedition did something very similar by converting button presses into ASCII-represented strings of the input buttons that were then CRC-ed. The approach was similar to just brute-force in Python and compare to the extracted cheat hashes.

I even spy your CRC32 table hidden in the `decrypted_ints` . The pre-generated tables are so easily searchable. It leaves me curious why they are so often found obfuscated in attempt to make it more difficult compared to generating a new one with your own polynomial.

Wow, a blog that focuses on the Sega Saturn!

Not too long ago, I found a Saturn in a closet at my parent’s house, along with a small handful of game CDs. I don’t have any recollection of owning one, so I’m guessing my little brother must have acquired it after I left for college. Anyway, I plugged it in and all the games worked! But other than that I have no idea what to do with it (obviously the trash is not an option).

The games are worth a fortune. I gave mine away in 2005 and now I get heart palpitations when I look them up on eBay.
Can we just take a moment to appreciate how incredibly odd the Ecco series is? For anyone that beat the games. You go from swimming in an ocean to flying with aliens. It's bizarre. Some people classify it as a horror game.
The name of the game probably comes from dolphins echolocation ability. Another explanation I like to entertain is that the name is a reference to John C Lilly. He was a scientist who believed in an alien organization called the Earth Coincidence Control Office or E.C.C.O. He also studied dolphin intelligence and communication. He gave dolphins LSD in an effort to communicate with them. John C Lilly is an interesting rabbit hole to go down.
My favorite aspect is the music, I regularly listen to the OST while working: https://youtu.be/tqMuvFEKCOk

I've played a decent amount (never finished it), but I never understood why people say it's a horror game?

It really is a game with a strange mix of aesthetics. Blue skies and bright colors in the early levels; suspense and dread and supernatural stuff in the later levels.

Another Ed Annunziata game called Three Dirty Dwarves is also stylistically unique.

You should look into PS2 version of this game, it seems to have same code for level unlock. Maybe it will be easier to reverse engineer and figure out what all codes do?
I wish there was more detail on "how" this was done as opposed to just the "what"
It's very much the "how", what were you looking for that's not explained in the blog post?
im curious about the process to find that initial buffer address - does that involve entering a few different strings and searching the memory snapshot for those byte patterns ?
Yeah, exactly! I took a couple memory snapshots of the name "AAA" and then threw out all of the addresses that had values that didn't match the first snapshot. Then I changed it to "BBB" and threw out all the addresses that did match.

There's a program called Cheat Engine that can make this a point and click thing; that's usually how people find GameShark-style codes.

Anyone else never beat the second level? Yes, we all eventually figured out that we had to jump over the rock wall… but after that… then what?
The next parts I vaguely remember: swim _very_ slow past an octopus arms (there's a hint but it's not necessarily clear that you have to be barely moving at all), hit key crystals and then the corresponding ~door crystals, and push a rock to drop and follow after them to avoid getting pushed back by the current.

It's generally a series of puzzles of that form and there's some ~light combat stuff.

The 3DS version was very cool. I plan on completing it there eventually. I wonder if those devs had source access.
I wish more people knew how to change to Ghidra's dark theme and change the font.
Is not this against the Ghidra EULA?