 
Packed was a reversing challenge rated with 500 points in NACTF. The hint said that angr is not going to help us with this.
The instructions said:
>Binaries too large? No worries, we'll use compression to fit your massive 4KB Unicode art! Let's begin by running the binary. It asks us for the flag:
Let's start by running the executable:
![](https://litios.github.io/assets/imgs/try.png)
Not very helpfull. Let's move on to the analysis.
---
The thing with this binary is that it doesn't have all the code declared so IDA doesn't recognise the code when we analize it statically.
This is how the main function looks like:
![](https://litios.github.io/assets/imgs/packed-main.png)
So my approach was to put a breakpoint in that `jmp rcx` at the end of the main function and keep moving. When we jump we see that we are at different segment called debug004.
![](https://litios.github.io/assets/imgs/debug.png)
We keep moving until we hit where the code prints and ask for input:
![](https://litios.github.io/assets/imgs/firstfunc.png)
Now that we know where the code we want is we can create a function in IDA and get the graph:
![](https://litios.github.io/assets/imgs/graph.png)
The first check that the program makes is if the length of the input is 0x40 so now we know the length.
Then, we keep going until we hit unk_7FDC3F9DA0A0, which looks interesting because it's the last function before saying right or wrong. We create an IDA function at that position and we get the graph:
![](https://litios.github.io/assets/imgs/unk-function.png)
It is loading the contents of that variable into `rax` and then it's comparing our input in `rdi` (I found out this after checking the contents of `rdi` in runtime). But as we can see, its picking the letters that are in positions divisible by 5 and comparing against our string.
So we dump the contents of that variable:
```nV&Bba_TG^cNk