Tags: python vm reversing 

Rating:

```
Are we not all but turtles drifting in the sea, executing instructions as we stumble upon them?

solves: 27
```
[turt.py (From googleCTF github)](https://github.com/google/google-ctf/blob/master/2023/rev-turtle/attachments/turt.py)

This is a vm implemented using turtles! After watching the program run for a bit, we can observe what each turtle are responsible for. I then write a translator (translate.py) from c.png “code” file to get a psuedocode (trans.txt) of the program. We notice that the program first check for the flag format, then make sure all characters are unique, make sure the characters are in a specific order, and lastly run some function on each character. It took a while to understand that the function is actually a binary search on the character value, and match each step with some value in memory. To recover the flag, I extract the reference value, take all the found characters, and order it using the reording in the memory. See simplify.txt for notes taken during the process, and solve.py for more detail.

`CTF{iT5_E-tUr+1es/AlL.7h3;waY:d0Wn}`

[link to blog](https://bronson113.github.io/2023/06/26/googlectf-2023-writeup.html#turtle)

Original writeup (https://bronson113.github.io/2023/06/26/googlectf-2023-writeup.html#turtle).