Cracking 'The Game': A Tetris Twist to Capture the Flag! 🕵️♂️
Hey fellow hackers and curious minds! 🕵️♀️ Ever played a game that seemed… too simple? One that whispered secrets from the corners of its pixelated world? 🤫 Well, buckle up, because today we’re diving deep into a TryHackMe room called “The Game” – a challenge that took a beloved classic and turned it into a thrilling hunt for a hidden flag. 🏁 This isn’t just about stacking blocks; it’s about peeling back the layers of the game itself! 🧅
The Setup: Gearing Up for a Digital Heist 🛠️
Before we could even dream of prying open this digital puzzle box 🎁, we needed the right set of keys. Our mission, should we choose to accept it (and we did! 😎), required a couple of essential tools:
Godot Engine: The very stage on which our game performs. We needed this to peek behind the curtain 🫣 and, eventually, rewrite the script. You can grab it from Godot Engine’s official website.
GDRE Decompiler (gdsdecomp): Think of this as our digital lockpick set 🧰. Godot games often come in packed
.pck
files, and this nifty tool helps us unpack them and recover the precious source code. Snag it from the GDRETools GitHub releases.THM The Game Room: The Game.
A Quick Note: 📝 The creators advised using Windows for this room, as Linux can apparently turn the download and setup process into an epic saga of its own. Heeding this wisdom, we ventured forth on a Windows environment. 💻
Act I: The Deceptively Simple Facade 🎭
The adventure began with a mysterious zip file 📁, the kind that always promises more than it initially shows. Inside, we found an .exe
file and a Mac executable. Being on our Windows setup, we cautiously ran the .exe
.
Lo and behold, a Tetris-like game flickered to life! 🧱 Blocks fell, lines cleared – all seemed normal. But then, a glint of something unusual caught our eye. In the top right corner, a score counter, and next to it, a tantalizing message: “Score more than 999999”. ✨
Image: Close-up screenshot of the “Score more than 999999 Hmm, interesting. 🤔 A score that high in Tetris? That’s not just a challenge; that’s a digital Everest! 🏔️ This cryptic message felt like a breadcrumb, a deliberate clue left by the game’s architect. We filed it away in our mental detective notebook 📓, knowing it would be crucial later.
Act II: Unmasking the Engine 🔍
As we pondered the game, its very icon seemed to whisper a clue. It had that distinct look, a certain je ne sais quoi that screamed… Godot Engine! 📢
Screenshot of the game’s icon, highlighting its Godot-like appearance How can one usually tell? Well, Godot games often have a default icon if the developer doesn’t change it. Sometimes, the file structure of the installed game, or even strings within the executable, can give it away. In this case, the visual cue was strong enough to point us in the right direction. Knowing the game engine is like knowing the language the game speaks 🗣️ – a vital step in our reverse-engineering quest.
Act III: Cracking Open the Treasure Chest 🔓
With “Godot” as our guiding star ⭐, it was time to bring out the GDRE Decompiler. Our mission: to extract the game’s source files from its packed .pck
archive. This is where the real magic begins, transforming us from mere players to potential puppet masters. 🪄
We fired up the GDRE Tools, pointed it towards our game’s executable (or its associated .pck
file, often found alongside the .exe
), specified an extraction path, and hit “Extract.” 💨
Step 2: Choose Recover Project from the menu
Step 3: Select the exe of the Game
Step 4: Select the target directory and click on Extract to extract the game files
Like a digital archaeologist unearthing ancient scrolls 📜, the decompiler worked its magic, laying bare the game’s skeletal structure – its scripts, assets, and project files.
Act IV: Stepping Into the Developer’s Shoes 👨💻👩💻
With the source files liberated, our next move was to import this newfound treasure into the Godot Engine itself. This step is like finding the blueprints to a house blueprints 🗺️ and then using an architectural program to explore it in 3D.
Step 1: Click on import to import the game’s project files
Step 2: Select the project.godot file from the previously extracted folder and click open
Step 3: Click on import to import the game project
We launched Godot, selected “Import Project,” navigated to the folder where we extracted the game’s files, and selected the project.godot
file. The engine hummed, processed, and then… voila! 🎉 The game’s entire codebase, its scenes, its logic, all laid out before us. We were no longer outside looking in; we were inside the machine. ⚙️
Act V: The “Aha!” Moment – Chasing the Numerical Ghost 👻
Remember that curious score requirement? “Score more than 999999.” It was time to revisit that clue. If reaching such a monumental score triggered something special, the logic for it had to be lurking somewhere in the game’s code. 🧐
Godot Engine has a fantastic “Search in Files” feature – our digital bloodhound 🐕. We unleashed it, feeding it the number 999999
.
Step 1: Choose find in files from the dropdown menu
Step 2: search for the number 999999 and click find
The search was swift and true! 🎯 It returned a result, highlighting a line of code. A single click transported us directly to the heart of the mystery: an if
condition.
1
2
3
4
# Example of what the code might have looked like
if score >= 999999:
# Something interesting happens here... maybe the flag? 🚩
$ButtonContainer / T.show()
Step 3: Select the search result to load teh file in the editor
There it was, plain as day! A condition checking if the player’s score had surpassed that magical threshold. The game was indeed designed to react to this specific achievement.
Act VI: Rewriting Destiny (and the Code) ✍️
Now, we could have spent weeks, months, maybe even years, honing our Tetris skills to legitimately reach a score of 999,999+. Or… we could take a shortcut. 😉 After all, we were hackers, not pro Tetris players (at least, not in this context!).
The idea was deliciously simple: What if we didn’t need to reach that score? What if the game thought we reached it with a much, much lower score? Say, a score of… zero? 🤯
With the power of the Godot editor at our fingertips, we made a tiny, yet monumental, change. We altered the condition:
1
2
3
4
5
6
# The original line:
# if score >= 999999:
# Our mischievous modification:
if score >= 0: # Or even score >= 1 if 0 is the starting score
$ButtonContainer / T.show()
By changing 999999
to 0
(or a similarly trivial number that would be met instantly), we effectively told the game, “Hey, as soon as the game starts, assume I’m a Tetris god 👑 and show me the prize!”
Act VII: The Grand Reveal 🎊
The moment of truth. We saved our changes to the script. Our hearts pounded with anticipation. 🥁 In Godot, pressing F5
(or the “Play” button) runs the game with any modifications. We took a deep breath and pressed F5
.
Image: Screenshot of the game running after the code modification, prominently displaying the flag
The game launched. And there it was. No grueling Tetris marathon. No impossible score. Just… the flag! 🚩 Revealed instantly, thanks to our little tweak in its digital DNA.
Conclusion: The Game Within The Game 🎮➡️🧩
This “The Game” CTF room was a fantastic reminder that often, the most intriguing puzzles aren’t the ones presented upfront, but the ones hidden within the mechanics themselves. By understanding the tools of game development and a bit of reverse engineering, we turned a seemingly straightforward game into an open book. 📖
It was a thrilling journey from player to detective to code-bending sorcerer. 🧙♂️ And the flag? Well, that was just the cherry on top 🍒 of a very satisfying digital cake. 🍰