theflagishere!
CATEGORY - REVERSING
Last updated
CATEGORY - REVERSING
Last updated
In this reversing challenge, I was given a Python compiled .pyc
file. The description hinted that the program was supposed to determine the flag, but it didn't explicitly display it. My task was to reverse-engineer the file and extract the correct flag.
.pyc
fileAfter analyzing the decompiled code, I noticed a few issues:
The what_do_i_do
function contained a return
inside a loop that would never execute properly.
There were several unnecessary function calls that seemed misleading.
Some of the flag extraction logic seemed obfuscated but could be simplified
I corrected the function:
After fixing the logic, I reconstructed the flag by calling the appropriate functions in sequence:
Running the script printed the final flag:
That’s how I solved this challenge. Thanks for reading!
Since a .pyc
file is a compiled Python file, I needed to decompile it back to readable Python code. To do this, I used an online tool: . I uploaded the .pyc
file, and it provided me with the following Python script: