Block CTF | Red Flags (Rev, Godot Game Hacking)

Difficulty : Beginner

I don't usually do reverse engineering but this is a very easy one.

This challenge consists of a godot game, this challenge has flags that would be activated or deactivated, each combination moves the flag letters, so unless we would try every possible combination we would need to find a way to hack the game.

We can decompile the game easily with gdsdecomparrow-up-right, after decompiling it we get the code.

We first see that the characters are each stored as char, there is no proper order in the code so we analyze further.

We have two GDScript files, arena.tscn for the game and flag.tscn for the flags :

arena.tscn :

flag.tscn :

movable_char.gd that controls the movement of the chars :

Now we can see in the arena file that the game reads the flag combinations, generates a hash that it concats to another hash and then from it takes the position of the characters, so from that we can conclude we would need to brute force this.

My strategy was to bruteforce each combination and screenshot every frame, so first we need to change the arena file to include screenshotting and loop through every combination.

we added a function to generate every possible array of results and added a global variable X that would track the combinaitions, we also added screenshotting to every frame.

but now we have a problem, the letters don't just pop out to their detination, they would travel to that position.

for that we would need to edit the movable_char.gd and make it so it dosen't lerp to that destination

an optional thing to do is to add a 30 fps maximum in arena.tscn to be able to see the flag when it pops out and get an approximate screenshot count for when the flag pops out.

We can also reduce the amount of screenshots by seeing that the flag pops out at around the 500th screenshot.

we run the app now and get our flag :

Now that I think about it, I could've just read the letters and guessed the flag, it would've taken less time.

Last updated