Rating:

# Rev80 - Eso Tape

## Description

I once took a nap on my keyboard. I dreamed of a brand new language, but I could not decipher it nor get its meaning. Can you help me? Hint: Replace the spaces with either '{' or '}' in the solution. Hint: Interpreters don't help. Operations write to the current index.

## Solution

With a bit of research we found out that the programming language used in this challenge is called TapeBagel.

This is the program reversed.


## resets all of the integers to zero
%% resets the integer index to zero
%++ i++
%++ i++
%++ i = 3
%# i
*&* i = 9
@** print i -> 9 -> I
%# i
**&* i = i*i = 27
***-* i = i - i = 24
***-* i = 21
%++ i++
%++ i++
@*** print i -> 21 -> W
*-* i = 0
@*** print i -> ' ' -> {
@** print i -> 9 -> I
*+** i = i + i = 12
@*** print i -> 12 -> L
***+* i = i + i = 12 + 3 = 15
@*** print i -> 15 -> O
**+** i = i + i = 18
***+* i = i + i = 21
%++ i++
@*** print i -> 22 -> V
#% sets all the integers to one
%% resets the integer index to zero
%++ i++
%++ i++
%++ i++
%++ i++ -> i = 5
@* print i -> 5 -> E
%# adds one to the integer index
%++ i++
%++ i++
%++ i++ -> i = 4
%% resets the integer index to zero
*&** i = i * i = 20
@* print i -> 20 -> T
@*** print i -> 1 -> A
*-** i = i - i = 16
@* print i -> 16 -> P
%# adds one to the integer index
%++ i++ -> i = 5
@** print i -> 5 -> E
*-** i = i - i = 11
*-** i = i - i = 5
**-*** i = i - i = 4
**-*** i = i - i = 3
**-*** i = i - i = 2
@** print i -> 2 -> B
@*** print i -> 1 -> A
#% sets all the integers to one
%% resets the integer index to zero
%++ i++
%++ i++
%++ i++
%++ i++ -> i = 5
%# adds one to the integer index
*+** i = i + i = 6
%++ i++ -> i = 7
@** print i -> 7 -> G
@* print i -> 5 -> E
%# adds one to the integer index
*+** i = i + i = 12
@*** print i -> 12 -> L
## resets all of the integers to zero
%% resets the integer index to zero
@*** print i -> 0 -> ' '


In the end, ~~it doesn't even~~ the flag is IW{ILOVETAPEBAGEL}

Original writeup (https://github.com/QuokkaLight/write-ups/blob/master/internetwache-ctf-2016/reverse/rev80.md).