Tags: gdb 

Rating:

Being terrible at assembly and reversing, I stumbled through this but still got
the flag. First, I downloaded the provided binary and loaded it in
[Binary Ninja](https://binary.ninja/). Looking at the graph, I could see that
the "decrypted" flag is stored is a `flag_buf` variable at `0x6013e8` and that
the `decrypt_flag` function returns at `0x4008c8`.

With that information, we can fire up dbg :

```bash
gdb run
```

Then set up a break point at `0x4008c8` and execute until we reach the
breakpoint :

```
break *0x4008c8
run
```

Once the breakpoint is reached, we read the string stored at `0x6013e8` :

```
x/s *0x6013e8
```

And that gives us the flag : `picoCTF{gDb_iS_sUp3r_u53fuL_efaa2b29}`

Original writeup (http://blog.iodbh.net/picoctf2018-misc-learn-gdb.html).