reverse_cipher
Last updated
Was this helpful?
Last updated
Was this helpful?
We have recovered a binary and a text file. Can you reverse the flag. Its also found in /problems/reverse-cipher_0_b784b7d0e499d532eba7269bfdf6a21d on the shell server.
cat rev_this
shows picoCTF{w1{1wq87g_9654g}
.
Decompile the binary file using ():
This is just a simple script that performs a few shifts on the characters of the flag. Characters 0-7 are left as is. Characters 8-22 alternate between adding 5 and subtracting 2, starting with adding 5. local_14 & 1
does a bitwise AND between the current iteration number and 1. The if statement checks if this equals 0
. It will equal 0
every other iteration because & 1
checks if the last bit is 0 or 1 and returns 1 if the last bit is 1, and otherwise returns 0. Finally, the last character (the 23rd one) is added on to the file as is.
Run the to reverse this logic and get the flag.
picoCTF{r3v3rs39ba4806b}