Tags: reverse engineering 

Rating:

1. View the code. The flag is stored inside inp[] array. The array has a length of 17 blocks.
2. Let's restructure the array.

a = "LTR"
b = "0D"
c = "S1"

* inp[0] == a[2] -> R
* inp[1] == a[1] -> T
* inp[2] == a[0] -> L
* inp[3] == "{" -> {
* inp[4] + inp[5] == b[::-1] -> D0
* inp[6] == "N" -> N
* inp[7] == "T" -> T
* inp[8] == chr(95) -> _
* inp[9] + inp [10] == b[::-1] -> D0
* inp[11] + inp[12] + inp[13] == "TH" -> TH
* inp[14] + inp[15] == c[::-1] -> 1S
* inp[16] == "}" -> }

Reference:
1. What is the meaning of “int(a[::-1])” in Python?
[ https://stackoverflow.com/questions/31633635/what-is-the-meaning-of-inta-1-in-python/31633656 ]

Original writeup (https://aamcyberkingdom.github.io/).