2023 HuntressCTF - Rock, Paper, Psychic

2023-11-01

Summary

Author: @HuskyHacks

Wanna play a game of rock, paper, scissors against a computer that can read your mind? Sounds fun, right?

Steps

I downloaded the executable to my Flare Windows VM and executed it. I was presented with a game of rock, paper, scissors.

Unfortunately, reverse engineering is not something i’m very skilled at and this challenge took me a while to figure out exactly what was going on. To start the RE process, I fired up Ghidra and loaded the file. I let Ghidra auto analyze the file and I started to look through the Imports, Exports and functions. I discovered the playerWins__main_10 function.

I navigated to the XREF to see where this function would be called from and I see there is an instruction JNZ. Here the function would not be called and skipped over since the condition was not met. I changed the instruction to JZ.

Lastly, I exported the program as rock_paper_psychic-new.exe and ran it again and got the flag: flag{35bed450ed9ac9fcb3f5f8d547873be9}

Special Thanks to Talnet23 to providing guidance on this challenge