PicoCTF challenges : Easiest way to tackle Transformation: 104 (Reverse Engineering)
In this article, I will be talking about this interesting reverse engineering problem. As we can see, its only 55% liked which means the problem is indeed simple yet difficult for meager 20 points. After intense 2-hr trial and error, I figured the problem required us to reverse the code snippet after enc above and decode file enc. enc has been encoded using UTF-8 with the code above
Procedure
- First we need to download the enc file and view it below.
2. We need to reverse the code : '.join([chr((ord(flag[i]) << 8) + ord(flag[i + 1])) for i in range(0, len(flag), 2)]).
I bumped to chatGPT and reversed the code as below (Hail chatGPT!!)
3. We need to paste the code to our VS code and tweak it to solve our problem now. We basically add a few lines that point to the enc file. It reads it and then creates a flag variable that is updated upon successful decryption of a character. After running the code, we see the flag as below :) → picoCTF{16_bits_inst34d_of_8_e703b486}
Follow-up notes:
Keep reading on Python and Advanced encoding/decoding algorithms. Furthemore, practice ctf problems and use chatGPT