> For the complete documentation index, see [llms.txt](https://kos0ng.gitbook.io/ctfs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kos0ng.gitbook.io/ctfs/write-up/2021/compfest-quals/reverse-engineering.md).

# Reverse Engineering

<table><thead><tr><th width="347">Challenge</th><th>Link</th></tr></thead><tbody><tr><td>Binary Pin (454 pts)</td><td><a href="#binary-pin-454-pts">Here</a></td></tr><tr><td>Magical Mystery Club (482 pts)</td><td><a href="#magical-mystery-club-482-pts">Here</a></td></tr><tr><td>Pave The Way (494 pts)🥇</td><td><a href="#pave-the-way-494-pts">Here</a></td></tr></tbody></table>

## Binary Pin (454 pts)

### Description

\-

### Solution

Diberikan file jar , kemudian kami coba decompile. Disini kami sempat overthinking mengenai cara mengerjakannya , kemudian baru sadar disini tugas kita adalah memasukkan key yang benar. Dimana nilai key sendiri 9 bit , jadi possible sekali untuk di bruteforce , jadi tinggal bruteforce key dan dump resultnya lalu analisis manual atau grep .&#x20;

Generate possible key

```python
from itertools import product

for i in product(["0","1"],repeat=9):
    tmp = []
    for j in range(9):
   	 tmp.append(i[j])
    print(tmp)
```

Bruteforce key

```java
import java.util.*;
class Main{

   public static void main(String[] args) {
  	char arr[][] = {{'0', '0', '0', '0', '0', '0', '0', '0', '0'},{'0', '0', '0', '0', '0', '0', '0', '0', '1'},{'0', '0', '0', '0', '0', '0', '0', '1', '0'},{'0', '0', '0', '0', '0', '0', '0', '1', '1'},{'0', '0', '0', '0', '0', '0', '1', '0', '0'},{'0', '0', '0', '0', '0', '0', '1', '0', '1'},{'0', '0', '0', '0', '0', '0', '1', '1', '0'},{'0', '0', '0', '0', '0', '0', '1', '1', '1'},{'0', '0', '0', '0', '0', '1', '0', '0', '0'},{'0', '0', '0', '0', '0', '1', '0', '0', '1'},{'0', '0', '0', '0', '0', '1', '0', '1', '0'},{'0', '0', '0', '0', '0', '1', '0', '1', '1'},{'0', '0', '0', '0', '0', '1', '1', '0', '0'},{'0', '0', '0', '0', '0', '1', '1', '0', '1'},{'0', '0', '0', '0', '0', '1', '1', '1', '0'},{'0', '0', '0', '0', '0', '1', '1', '1', '1'},{'0', '0', '0', '0', '1', '0', '0', '0', '0'},{'0', '0', '0', '0', '1', '0', '0', '0', '1'},{'0', '0', '0', '0', '1', '0', '0', '1', '0'},{'0', '0', '0', '0', '1', '0', '0', '1', '1'},{'0', '0', '0', '0', '1', '0', '1', '0', '0'},{'0', '0', '0', '0', '1', '0', '1', '0', '1'},{'0', '0', '0', '0', '1', '0', '1', '1', '0'},{'0', '0', '0', '0', '1', '0', '1', '1', '1'},{'0', '0', '0', '0', '1', '1', '0', '0', '0'},{'0', '0', '0', '0', '1', '1', '0', '0', '1'},{'0', '0', '0', '0', '1', '1', '0', '1', '0'},{'0', '0', '0', '0', '1', '1', '0', '1', '1'},{'0', '0', '0', '0', '1', '1', '1', '0', '0'},{'0', '0', '0', '0', '1', '1', '1', '0', '1'},{'0', '0', '0', '0', '1', '1', '1', '1', '0'},{'0', '0', '0', '0', '1', '1', '1', '1', '1'},{'0', '0', '0', '1', '0', '0', '0', '0', '0'},{'0', '0', '0', '1', '0', '0', '0', '0', '1'},{'0', '0', '0', '1', '0', '0', '0', '1', '0'},{'0', '0', '0', '1', '0', '0', '0', '1', '1'},{'0', '0', '0', '1', '0', '0', '1', '0', '0'},{'0', '0', '0', '1', '0', '0', '1', '0', '1'},{'0', '0', '0', '1', '0', '0', '1', '1', '0'},{'0', '0', '0', '1', '0', '0', '1', '1', '1'},{'0', '0', '0', '1', '0', '1', '0', '0', '0'},{'0', '0', '0', '1', '0', '1', '0', '0', '1'},{'0', '0', '0', '1', '0', '1', '0', '1', '0'},{'0', '0', '0', '1', '0', '1', '0', '1', '1'},{'0', '0', '0', '1', '0', '1', '1', '0', '0'},{'0', '0', '0', '1', '0', '1', '1', '0', '1'},{'0', '0', '0', '1', '0', '1', '1', '1', '0'},{'0', '0', '0', '1', '0', '1', '1', '1', '1'},{'0', '0', '0', '1', '1', '0', '0', '0', '0'},{'0', '0', '0', '1', '1', '0', '0', '0', '1'},{'0', '0', '0', '1', '1', '0', '0', '1', '0'},{'0', '0', '0', '1', '1', '0', '0', '1', '1'},{'0', '0', '0', '1', '1', '0', '1', '0', '0'},{'0', '0', '0', '1', '1', '0', '1', '0', '1'},{'0', '0', '0', '1', '1', '0', '1', '1', '0'},{'0', '0', '0', '1', '1', '0', '1', '1', '1'},{'0', '0', '0', '1', '1', '1', '0', '0', '0'},{'0', '0', '0', '1', '1', '1', '0', '0', '1'},{'0', '0', '0', '1', '1', '1', '0', '1', '0'},{'0', '0', '0', '1', '1', '1', '0', '1', '1'},{'0', '0', '0', '1', '1', '1', '1', '0', '0'},{'0', '0', '0', '1', '1', '1', '1', '0', '1'},{'0', '0', '0', '1', '1', '1', '1', '1', '0'},{'0', '0', '0', '1', '1', '1', '1', '1', '1'},{'0', '0', '1', '0', '0', '0', '0', '0', '0'},{'0', '0', '1', '0', '0', '0', '0', '0', '1'},{'0', '0', '1', '0', '0', '0', '0', '1', '0'},{'0', '0', '1', '0', '0', '0', '0', '1', '1'},{'0', '0', '1', '0', '0', '0', '1', '0', '0'},{'0', '0', '1', '0', '0', '0', '1', '0', '1'},{'0', '0', '1', '0', '0', '0', '1', '1', '0'},{'0', '0', '1', '0', '0', '0', '1', '1', '1'},{'0', '0', '1', '0', '0', '1', '0', '0', '0'},{'0', '0', '1', '0', '0', '1', '0', '0', '1'},{'0', '0', '1', '0', '0', '1', '0', '1', '0'},{'0', '0', '1', '0', '0', '1', '0', '1', '1'},{'0', '0', '1', '0', '0', '1', '1', '0', '0'},{'0', '0', '1', '0', '0', '1', '1', '0', '1'},{'0', '0', '1', '0', '0', '1', '1', '1', '0'},{'0', '0', '1', '0', '0', '1', '1', '1', '1'},{'0', '0', '1', '0', '1', '0', '0', '0', '0'},{'0', '0', '1', '0', '1', '0', '0', '0', '1'},{'0', '0', '1', '0', '1', '0', '0', '1', '0'},{'0', '0', '1', '0', '1', '0', '0', '1', '1'},{'0', '0', '1', '0', '1', '0', '1', '0', '0'},{'0', '0', '1', '0', '1', '0', '1', '0', '1'},{'0', '0', '1', '0', '1', '0', '1', '1', '0'},{'0', '0', '1', '0', '1', '0', '1', '1', '1'},{'0', '0', '1', '0', '1', '1', '0', '0', '0'},{'0', '0', '1', '0', '1', '1', '0', '0', '1'},{'0', '0', '1', '0', '1', '1', '0', '1', '0'},{'0', '0', '1', '0', '1', '1', '0', '1', '1'},{'0', '0', '1', '0', '1', '1', '1', '0', '0'},{'0', '0', '1', '0', '1', '1', '1', '0', '1'},{'0', '0', '1', '0', '1', '1', '1', '1', '0'},{'0', '0', '1', '0', '1', '1', '1', '1', '1'},{'0', '0', '1', '1', '0', '0', '0', '0', '0'},{'0', '0', '1', '1', '0', '0', '0', '0', '1'},{'0', '0', '1', '1', '0', '0', '0', '1', '0'},{'0', '0', '1', '1', '0', '0', '0', '1', '1'},{'0', '0', '1', '1', '0', '0', '1', '0', '0'},{'0', '0', '1', '1', '0', '0', '1', '0', '1'},{'0', '0', '1', '1', '0', '0', '1', '1', '0'},{'0', '0', '1', '1', '0', '0', '1', '1', '1'},{'0', '0', '1', '1', '0', '1', '0', '0', '0'},{'0', '0', '1', '1', '0', '1', '0', '0', '1'},{'0', '0', '1', '1', '0', '1', '0', '1', '0'},{'0', '0', '1', '1', '0', '1', '0', '1', '1'},{'0', '0', '1', '1', '0', '1', '1', '0', '0'},{'0', '0', '1', '1', '0', '1', '1', '0', '1'},{'0', '0', '1', '1', '0', '1', '1', '1', '0'},{'0', '0', '1', '1', '0', '1', '1', '1', '1'},{'0', '0', '1', '1', '1', '0', '0', '0', '0'},{'0', '0', '1', '1', '1', '0', '0', '0', '1'},{'0', '0', '1', '1', '1', '0', '0', '1', '0'},{'0', '0', '1', '1', '1', '0', '0', '1', '1'},{'0', '0', '1', '1', '1', '0', '1', '0', '0'},{'0', '0', '1', '1', '1', '0', '1', '0', '1'},{'0', '0', '1', '1', '1', '0', '1', '1', '0'},{'0', '0', '1', '1', '1', '0', '1', '1', '1'},{'0', '0', '1', '1', '1', '1', '0', '0', '0'},{'0', '0', '1', '1', '1', '1', '0', '0', '1'},{'0', '0', '1', '1', '1', '1', '0', '1', '0'},{'0', '0', '1', '1', '1', '1', '0', '1', '1'},{'0', '0', '1', '1', '1', '1', '1', '0', '0'},{'0', '0', '1', '1', '1', '1', '1', '0', '1'},{'0', '0', '1', '1', '1', '1', '1', '1', '0'},{'0', '0', '1', '1', '1', '1', '1', '1', '1'},{'0', '1', '0', '0', '0', '0', '0', '0', '0'},{'0', '1', '0', '0', '0', '0', '0', '0', '1'},{'0', '1', '0', '0', '0', '0', '0', '1', '0'},{'0', '1', '0', '0', '0', '0', '0', '1', '1'},{'0', '1', '0', '0', '0', '0', '1', '0', '0'},{'0', '1', '0', '0', '0', '0', '1', '0', '1'},{'0', '1', '0', '0', '0', '0', '1', '1', '0'},{'0', '1', '0', '0', '0', '0', '1', '1', '1'},{'0', '1', '0', '0', '0', '1', '0', '0', '0'},{'0', '1', '0', '0', '0', '1', '0', '0', '1'},{'0', '1', '0', '0', '0', '1', '0', '1', '0'},{'0', '1', '0', '0', '0', '1', '0', '1', '1'},{'0', '1', '0', '0', '0', '1', '1', '0', '0'},{'0', '1', '0', '0', '0', '1', '1', '0', '1'},{'0', '1', '0', '0', '0', '1', '1', '1', '0'},{'0', '1', '0', '0', '0', '1', '1', '1', '1'},{'0', '1', '0', '0', '1', '0', '0', '0', '0'},{'0', '1', '0', '0', '1', '0', '0', '0', '1'},{'0', '1', '0', '0', '1', '0', '0', '1', '0'},{'0', '1', '0', '0', '1', '0', '0', '1', '1'},{'0', '1', '0', '0', '1', '0', '1', '0', '0'},{'0', '1', '0', '0', '1', '0', '1', '0', '1'},{'0', '1', '0', '0', '1', '0', '1', '1', '0'},{'0', '1', '0', '0', '1', '0', '1', '1', '1'},{'0', '1', '0', '0', '1', '1', '0', '0', '0'},{'0', '1', '0', '0', '1', '1', '0', '0', '1'},{'0', '1', '0', '0', '1', '1', '0', '1', '0'},{'0', '1', '0', '0', '1', '1', '0', '1', '1'},{'0', '1', '0', '0', '1', '1', '1', '0', '0'},{'0', '1', '0', '0', '1', '1', '1', '0', '1'},{'0', '1', '0', '0', '1', '1', '1', '1', '0'},{'0', '1', '0', '0', '1', '1', '1', '1', '1'},{'0', '1', '0', '1', '0', '0', '0', '0', '0'},{'0', '1', '0', '1', '0', '0', '0', '0', '1'},{'0', '1', '0', '1', '0', '0', '0', '1', '0'},{'0', '1', '0', '1', '0', '0', '0', '1', '1'},{'0', '1', '0', '1', '0', '0', '1', '0', '0'},{'0', '1', '0', '1', '0', '0', '1', '0', '1'},{'0', '1', '0', '1', '0', '0', '1', '1', '0'},{'0', '1', '0', '1', '0', '0', '1', '1', '1'},{'0', '1', '0', '1', '0', '1', '0', '0', '0'},{'0', '1', '0', '1', '0', '1', '0', '0', '1'},{'0', '1', '0', '1', '0', '1', '0', '1', '0'},{'0', '1', '0', '1', '0', '1', '0', '1', '1'},{'0', '1', '0', '1', '0', '1', '1', '0', '0'},{'0', '1', '0', '1', '0', '1', '1', '0', '1'},{'0', '1', '0', '1', '0', '1', '1', '1', '0'},{'0', '1', '0', '1', '0', '1', '1', '1', '1'},{'0', '1', '0', '1', '1', '0', '0', '0', '0'},{'0', '1', '0', '1', '1', '0', '0', '0', '1'},{'0', '1', '0', '1', '1', '0', '0', '1', '0'},{'0', '1', '0', '1', '1', '0', '0', '1', '1'},{'0', '1', '0', '1', '1', '0', '1', '0', '0'},{'0', '1', '0', '1', '1', '0', '1', '0', '1'},{'0', '1', '0', '1', '1', '0', '1', '1', '0'},{'0', '1', '0', '1', '1', '0', '1', '1', '1'},{'0', '1', '0', '1', '1', '1', '0', '0', '0'},{'0', '1', '0', '1', '1', '1', '0', '0', '1'},{'0', '1', '0', '1', '1', '1', '0', '1', '0'},{'0', '1', '0', '1', '1', '1', '0', '1', '1'},{'0', '1', '0', '1', '1', '1', '1', '0', '0'},{'0', '1', '0', '1', '1', '1', '1', '0', '1'},{'0', '1', '0', '1', '1', '1', '1', '1', '0'},{'0', '1', '0', '1', '1', '1', '1', '1', '1'},{'0', '1', '1', '0', '0', '0', '0', '0', '0'},{'0', '1', '1', '0', '0', '0', '0', '0', '1'},{'0', '1', '1', '0', '0', '0', '0', '1', '0'},{'0', '1', '1', '0', '0', '0', '0', '1', '1'},{'0', '1', '1', '0', '0', '0', '1', '0', '0'},{'0', '1', '1', '0', '0', '0', '1', '0', '1'},{'0', '1', '1', '0', '0', '0', '1', '1', '0'},{'0', '1', '1', '0', '0', '0', '1', '1', '1'},{'0', '1', '1', '0', '0', '1', '0', '0', '0'},{'0', '1', '1', '0', '0', '1', '0', '0', '1'},{'0', '1', '1', '0', '0', '1', '0', '1', '0'},{'0', '1', '1', '0', '0', '1', '0', '1', '1'},{'0', '1', '1', '0', '0', '1', '1', '0', '0'},{'0', '1', '1', '0', '0', '1', '1', '0', '1'},{'0', '1', '1', '0', '0', '1', '1', '1', '0'},{'0', '1', '1', '0', '0', '1', '1', '1', '1'},{'0', '1', '1', '0', '1', '0', '0', '0', '0'},{'0', '1', '1', '0', '1', '0', '0', '0', '1'},{'0', '1', '1', '0', '1', '0', '0', '1', '0'},{'0', '1', '1', '0', '1', '0', '0', '1', '1'},{'0', '1', '1', '0', '1', '0', '1', '0', '0'},{'0', '1', '1', '0', '1', '0', '1', '0', '1'},{'0', '1', '1', '0', '1', '0', '1', '1', '0'},{'0', '1', '1', '0', '1', '0', '1', '1', '1'},{'0', '1', '1', '0', '1', '1', '0', '0', '0'},{'0', '1', '1', '0', '1', '1', '0', '0', '1'},{'0', '1', '1', '0', '1', '1', '0', '1', '0'},{'0', '1', '1', '0', '1', '1', '0', '1', '1'},{'0', '1', '1', '0', '1', '1', '1', '0', '0'},{'0', '1', '1', '0', '1', '1', '1', '0', '1'},{'0', '1', '1', '0', '1', '1', '1', '1', '0'},{'0', '1', '1', '0', '1', '1', '1', '1', '1'},{'0', '1', '1', '1', '0', '0', '0', '0', '0'},{'0', '1', '1', '1', '0', '0', '0', '0', '1'},{'0', '1', '1', '1', '0', '0', '0', '1', '0'},{'0', '1', '1', '1', '0', '0', '0', '1', '1'},{'0', '1', '1', '1', '0', '0', '1', '0', '0'},{'0', '1', '1', '1', '0', '0', '1', '0', '1'},{'0', '1', '1', '1', '0', '0', '1', '1', '0'},{'0', '1', '1', '1', '0', '0', '1', '1', '1'},{'0', '1', '1', '1', '0', '1', '0', '0', '0'},{'0', '1', '1', '1', '0', '1', '0', '0', '1'},{'0', '1', '1', '1', '0', '1', '0', '1', '0'},{'0', '1', '1', '1', '0', '1', '0', '1', '1'},{'0', '1', '1', '1', '0', '1', '1', '0', '0'},{'0', '1', '1', '1', '0', '1', '1', '0', '1'},{'0', '1', '1', '1', '0', '1', '1', '1', '0'},{'0', '1', '1', '1', '0', '1', '1', '1', '1'},{'0', '1', '1', '1', '1', '0', '0', '0', '0'},{'0', '1', '1', '1', '1', '0', '0', '0', '1'},{'0', '1', '1', '1', '1', '0', '0', '1', '0'},{'0', '1', '1', '1', '1', '0', '0', '1', '1'},{'0', '1', '1', '1', '1', '0', '1', '0', '0'},{'0', '1', '1', '1', '1', '0', '1', '0', '1'},{'0', '1', '1', '1', '1', '0', '1', '1', '0'},{'0', '1', '1', '1', '1', '0', '1', '1', '1'},{'0', '1', '1', '1', '1', '1', '0', '0', '0'},{'0', '1', '1', '1', '1', '1', '0', '0', '1'},{'0', '1', '1', '1', '1', '1', '0', '1', '0'},{'0', '1', '1', '1', '1', '1', '0', '1', '1'},{'0', '1', '1', '1', '1', '1', '1', '0', '0'},{'0', '1', '1', '1', '1', '1', '1', '0', '1'},{'0', '1', '1', '1', '1', '1', '1', '1', '0'},{'0', '1', '1', '1', '1', '1', '1', '1', '1'},{'1', '0', '0', '0', '0', '0', '0', '0', '0'},{'1', '0', '0', '0', '0', '0', '0', '0', '1'},{'1', '0', '0', '0', '0', '0', '0', '1', '0'},{'1', '0', '0', '0', '0', '0', '0', '1', '1'},{'1', '0', '0', '0', '0', '0', '1', '0', '0'},{'1', '0', '0', '0', '0', '0', '1', '0', '1'},{'1', '0', '0', '0', '0', '0', '1', '1', '0'},{'1', '0', '0', '0', '0', '0', '1', '1', '1'},{'1', '0', '0', '0', '0', '1', '0', '0', '0'},{'1', '0', '0', '0', '0', '1', '0', '0', '1'},{'1', '0', '0', '0', '0', '1', '0', '1', '0'},{'1', '0', '0', '0', '0', '1', '0', '1', '1'},{'1', '0', '0', '0', '0', '1', '1', '0', '0'},{'1', '0', '0', '0', '0', '1', '1', '0', '1'},{'1', '0', '0', '0', '0', '1', '1', '1', '0'},{'1', '0', '0', '0', '0', '1', '1', '1', '1'},{'1', '0', '0', '0', '1', '0', '0', '0', '0'},{'1', '0', '0', '0', '1', '0', '0', '0', '1'},{'1', '0', '0', '0', '1', '0', '0', '1', '0'},{'1', '0', '0', '0', '1', '0', '0', '1', '1'},{'1', '0', '0', '0', '1', '0', '1', '0', '0'},{'1', '0', '0', '0', '1', '0', '1', '0', '1'},{'1', '0', '0', '0', '1', '0', '1', '1', '0'},{'1', '0', '0', '0', '1', '0', '1', '1', '1'},{'1', '0', '0', '0', '1', '1', '0', '0', '0'},{'1', '0', '0', '0', '1', '1', '0', '0', '1'},{'1', '0', '0', '0', '1', '1', '0', '1', '0'},{'1', '0', '0', '0', '1', '1', '0', '1', '1'},{'1', '0', '0', '0', '1', '1', '1', '0', '0'},{'1', '0', '0', '0', '1', '1', '1', '0', '1'},{'1', '0', '0', '0', '1', '1', '1', '1', '0'},{'1', '0', '0', '0', '1', '1', '1', '1', '1'},{'1', '0', '0', '1', '0', '0', '0', '0', '0'},{'1', '0', '0', '1', '0', '0', '0', '0', '1'},{'1', '0', '0', '1', '0', '0', '0', '1', '0'},{'1', '0', '0', '1', '0', '0', '0', '1', '1'},{'1', '0', '0', '1', '0', '0', '1', '0', '0'},{'1', '0', '0', '1', '0', '0', '1', '0', '1'},{'1', '0', '0', '1', '0', '0', '1', '1', '0'},{'1', '0', '0', '1', '0', '0', '1', '1', '1'},{'1', '0', '0', '1', '0', '1', '0', '0', '0'},{'1', '0', '0', '1', '0', '1', '0', '0', '1'},{'1', '0', '0', '1', '0', '1', '0', '1', '0'},{'1', '0', '0', '1', '0', '1', '0', '1', '1'},{'1', '0', '0', '1', '0', '1', '1', '0', '0'},{'1', '0', '0', '1', '0', '1', '1', '0', '1'},{'1', '0', '0', '1', '0', '1', '1', '1', '0'},{'1', '0', '0', '1', '0', '1', '1', '1', '1'},{'1', '0', '0', '1', '1', '0', '0', '0', '0'},{'1', '0', '0', '1', '1', '0', '0', '0', '1'},{'1', '0', '0', '1', '1', '0', '0', '1', '0'},{'1', '0', '0', '1', '1', '0', '0', '1', '1'},{'1', '0', '0', '1', '1', '0', '1', '0', '0'},{'1', '0', '0', '1', '1', '0', '1', '0', '1'},{'1', '0', '0', '1', '1', '0', '1', '1', '0'},{'1', '0', '0', '1', '1', '0', '1', '1', '1'},{'1', '0', '0', '1', '1', '1', '0', '0', '0'},{'1', '0', '0', '1', '1', '1', '0', '0', '1'},{'1', '0', '0', '1', '1', '1', '0', '1', '0'},{'1', '0', '0', '1', '1', '1', '0', '1', '1'},{'1', '0', '0', '1', '1', '1', '1', '0', '0'},{'1', '0', '0', '1', '1', '1', '1', '0', '1'},{'1', '0', '0', '1', '1', '1', '1', '1', '0'},{'1', '0', '0', '1', '1', '1', '1', '1', '1'},{'1', '0', '1', '0', '0', '0', '0', '0', '0'},{'1', '0', '1', '0', '0', '0', '0', '0', '1'},{'1', '0', '1', '0', '0', '0', '0', '1', '0'},{'1', '0', '1', '0', '0', '0', '0', '1', '1'},{'1', '0', '1', '0', '0', '0', '1', '0', '0'},{'1', '0', '1', '0', '0', '0', '1', '0', '1'},{'1', '0', '1', '0', '0', '0', '1', '1', '0'},{'1', '0', '1', '0', '0', '0', '1', '1', '1'},{'1', '0', '1', '0', '0', '1', '0', '0', '0'},{'1', '0', '1', '0', '0', '1', '0', '0', '1'},{'1', '0', '1', '0', '0', '1', '0', '1', '0'},{'1', '0', '1', '0', '0', '1', '0', '1', '1'},{'1', '0', '1', '0', '0', '1', '1', '0', '0'},{'1', '0', '1', '0', '0', '1', '1', '0', '1'},{'1', '0', '1', '0', '0', '1', '1', '1', '0'},{'1', '0', '1', '0', '0', '1', '1', '1', '1'},{'1', '0', '1', '0', '1', '0', '0', '0', '0'},{'1', '0', '1', '0', '1', '0', '0', '0', '1'},{'1', '0', '1', '0', '1', '0', '0', '1', '0'},{'1', '0', '1', '0', '1', '0', '0', '1', '1'},{'1', '0', '1', '0', '1', '0', '1', '0', '0'},{'1', '0', '1', '0', '1', '0', '1', '0', '1'},{'1', '0', '1', '0', '1', '0', '1', '1', '0'},{'1', '0', '1', '0', '1', '0', '1', '1', '1'},{'1', '0', '1', '0', '1', '1', '0', '0', '0'},{'1', '0', '1', '0', '1', '1', '0', '0', '1'},{'1', '0', '1', '0', '1', '1', '0', '1', '0'},{'1', '0', '1', '0', '1', '1', '0', '1', '1'},{'1', '0', '1', '0', '1', '1', '1', '0', '0'},{'1', '0', '1', '0', '1', '1', '1', '0', '1'},{'1', '0', '1', '0', '1', '1', '1', '1', '0'},{'1', '0', '1', '0', '1', '1', '1', '1', '1'},{'1', '0', '1', '1', '0', '0', '0', '0', '0'},{'1', '0', '1', '1', '0', '0', '0', '0', '1'},{'1', '0', '1', '1', '0', '0', '0', '1', '0'},{'1', '0', '1', '1', '0', '0', '0', '1', '1'},{'1', '0', '1', '1', '0', '0', '1', '0', '0'},{'1', '0', '1', '1', '0', '0', '1', '0', '1'},{'1', '0', '1', '1', '0', '0', '1', '1', '0'},{'1', '0', '1', '1', '0', '0', '1', '1', '1'},{'1', '0', '1', '1', '0', '1', '0', '0', '0'},{'1', '0', '1', '1', '0', '1', '0', '0', '1'},{'1', '0', '1', '1', '0', '1', '0', '1', '0'},{'1', '0', '1', '1', '0', '1', '0', '1', '1'},{'1', '0', '1', '1', '0', '1', '1', '0', '0'},{'1', '0', '1', '1', '0', '1', '1', '0', '1'},{'1', '0', '1', '1', '0', '1', '1', '1', '0'},{'1', '0', '1', '1', '0', '1', '1', '1', '1'},{'1', '0', '1', '1', '1', '0', '0', '0', '0'},{'1', '0', '1', '1', '1', '0', '0', '0', '1'},{'1', '0', '1', '1', '1', '0', '0', '1', '0'},{'1', '0', '1', '1', '1', '0', '0', '1', '1'},{'1', '0', '1', '1', '1', '0', '1', '0', '0'},{'1', '0', '1', '1', '1', '0', '1', '0', '1'},{'1', '0', '1', '1', '1', '0', '1', '1', '0'},{'1', '0', '1', '1', '1', '0', '1', '1', '1'},{'1', '0', '1', '1', '1', '1', '0', '0', '0'},{'1', '0', '1', '1', '1', '1', '0', '0', '1'},{'1', '0', '1', '1', '1', '1', '0', '1', '0'},{'1', '0', '1', '1', '1', '1', '0', '1', '1'},{'1', '0', '1', '1', '1', '1', '1', '0', '0'},{'1', '0', '1', '1', '1', '1', '1', '0', '1'},{'1', '0', '1', '1', '1', '1', '1', '1', '0'},{'1', '0', '1', '1', '1', '1', '1', '1', '1'},{'1', '1', '0', '0', '0', '0', '0', '0', '0'},{'1', '1', '0', '0', '0', '0', '0', '0', '1'},{'1', '1', '0', '0', '0', '0', '0', '1', '0'},{'1', '1', '0', '0', '0', '0', '0', '1', '1'},{'1', '1', '0', '0', '0', '0', '1', '0', '0'},{'1', '1', '0', '0', '0', '0', '1', '0', '1'},{'1', '1', '0', '0', '0', '0', '1', '1', '0'},{'1', '1', '0', '0', '0', '0', '1', '1', '1'},{'1', '1', '0', '0', '0', '1', '0', '0', '0'},{'1', '1', '0', '0', '0', '1', '0', '0', '1'},{'1', '1', '0', '0', '0', '1', '0', '1', '0'},{'1', '1', '0', '0', '0', '1', '0', '1', '1'},{'1', '1', '0', '0', '0', '1', '1', '0', '0'},{'1', '1', '0', '0', '0', '1', '1', '0', '1'},{'1', '1', '0', '0', '0', '1', '1', '1', '0'},{'1', '1', '0', '0', '0', '1', '1', '1', '1'},{'1', '1', '0', '0', '1', '0', '0', '0', '0'},{'1', '1', '0', '0', '1', '0', '0', '0', '1'},{'1', '1', '0', '0', '1', '0', '0', '1', '0'},{'1', '1', '0', '0', '1', '0', '0', '1', '1'},{'1', '1', '0', '0', '1', '0', '1', '0', '0'},{'1', '1', '0', '0', '1', '0', '1', '0', '1'},{'1', '1', '0', '0', '1', '0', '1', '1', '0'},{'1', '1', '0', '0', '1', '0', '1', '1', '1'},{'1', '1', '0', '0', '1', '1', '0', '0', '0'},{'1', '1', '0', '0', '1', '1', '0', '0', '1'},{'1', '1', '0', '0', '1', '1', '0', '1', '0'},{'1', '1', '0', '0', '1', '1', '0', '1', '1'},{'1', '1', '0', '0', '1', '1', '1', '0', '0'},{'1', '1', '0', '0', '1', '1', '1', '0', '1'},{'1', '1', '0', '0', '1', '1', '1', '1', '0'},{'1', '1', '0', '0', '1', '1', '1', '1', '1'},{'1', '1', '0', '1', '0', '0', '0', '0', '0'},{'1', '1', '0', '1', '0', '0', '0', '0', '1'},{'1', '1', '0', '1', '0', '0', '0', '1', '0'},{'1', '1', '0', '1', '0', '0', '0', '1', '1'},{'1', '1', '0', '1', '0', '0', '1', '0', '0'},{'1', '1', '0', '1', '0', '0', '1', '0', '1'},{'1', '1', '0', '1', '0', '0', '1', '1', '0'},{'1', '1', '0', '1', '0', '0', '1', '1', '1'},{'1', '1', '0', '1', '0', '1', '0', '0', '0'},{'1', '1', '0', '1', '0', '1', '0', '0', '1'},{'1', '1', '0', '1', '0', '1', '0', '1', '0'},{'1', '1', '0', '1', '0', '1', '0', '1', '1'},{'1', '1', '0', '1', '0', '1', '1', '0', '0'},{'1', '1', '0', '1', '0', '1', '1', '0', '1'},{'1', '1', '0', '1', '0', '1', '1', '1', '0'},{'1', '1', '0', '1', '0', '1', '1', '1', '1'},{'1', '1', '0', '1', '1', '0', '0', '0', '0'},{'1', '1', '0', '1', '1', '0', '0', '0', '1'},{'1', '1', '0', '1', '1', '0', '0', '1', '0'},{'1', '1', '0', '1', '1', '0', '0', '1', '1'},{'1', '1', '0', '1', '1', '0', '1', '0', '0'},{'1', '1', '0', '1', '1', '0', '1', '0', '1'},{'1', '1', '0', '1', '1', '0', '1', '1', '0'},{'1', '1', '0', '1', '1', '0', '1', '1', '1'},{'1', '1', '0', '1', '1', '1', '0', '0', '0'},{'1', '1', '0', '1', '1', '1', '0', '0', '1'},{'1', '1', '0', '1', '1', '1', '0', '1', '0'},{'1', '1', '0', '1', '1', '1', '0', '1', '1'},{'1', '1', '0', '1', '1', '1', '1', '0', '0'},{'1', '1', '0', '1', '1', '1', '1', '0', '1'},{'1', '1', '0', '1', '1', '1', '1', '1', '0'},{'1', '1', '0', '1', '1', '1', '1', '1', '1'},{'1', '1', '1', '0', '0', '0', '0', '0', '0'},{'1', '1', '1', '0', '0', '0', '0', '0', '1'},{'1', '1', '1', '0', '0', '0', '0', '1', '0'},{'1', '1', '1', '0', '0', '0', '0', '1', '1'},{'1', '1', '1', '0', '0', '0', '1', '0', '0'},{'1', '1', '1', '0', '0', '0', '1', '0', '1'},{'1', '1', '1', '0', '0', '0', '1', '1', '0'},{'1', '1', '1', '0', '0', '0', '1', '1', '1'},{'1', '1', '1', '0', '0', '1', '0', '0', '0'},{'1', '1', '1', '0', '0', '1', '0', '0', '1'},{'1', '1', '1', '0', '0', '1', '0', '1', '0'},{'1', '1', '1', '0', '0', '1', '0', '1', '1'},{'1', '1', '1', '0', '0', '1', '1', '0', '0'},{'1', '1', '1', '0', '0', '1', '1', '0', '1'},{'1', '1', '1', '0', '0', '1', '1', '1', '0'},{'1', '1', '1', '0', '0', '1', '1', '1', '1'},{'1', '1', '1', '0', '1', '0', '0', '0', '0'},{'1', '1', '1', '0', '1', '0', '0', '0', '1'},{'1', '1', '1', '0', '1', '0', '0', '1', '0'},{'1', '1', '1', '0', '1', '0', '0', '1', '1'},{'1', '1', '1', '0', '1', '0', '1', '0', '0'},{'1', '1', '1', '0', '1', '0', '1', '0', '1'},{'1', '1', '1', '0', '1', '0', '1', '1', '0'},{'1', '1', '1', '0', '1', '0', '1', '1', '1'},{'1', '1', '1', '0', '1', '1', '0', '0', '0'},{'1', '1', '1', '0', '1', '1', '0', '0', '1'},{'1', '1', '1', '0', '1', '1', '0', '1', '0'},{'1', '1', '1', '0', '1', '1', '0', '1', '1'},{'1', '1', '1', '0', '1', '1', '1', '0', '0'},{'1', '1', '1', '0', '1', '1', '1', '0', '1'},{'1', '1', '1', '0', '1', '1', '1', '1', '0'},{'1', '1', '1', '0', '1', '1', '1', '1', '1'},{'1', '1', '1', '1', '0', '0', '0', '0', '0'},{'1', '1', '1', '1', '0', '0', '0', '0', '1'},{'1', '1', '1', '1', '0', '0', '0', '1', '0'},{'1', '1', '1', '1', '0', '0', '0', '1', '1'},{'1', '1', '1', '1', '0', '0', '1', '0', '0'},{'1', '1', '1', '1', '0', '0', '1', '0', '1'},{'1', '1', '1', '1', '0', '0', '1', '1', '0'},{'1', '1', '1', '1', '0', '0', '1', '1', '1'},{'1', '1', '1', '1', '0', '1', '0', '0', '0'},{'1', '1', '1', '1', '0', '1', '0', '0', '1'},{'1', '1', '1', '1', '0', '1', '0', '1', '0'},{'1', '1', '1', '1', '0', '1', '0', '1', '1'},{'1', '1', '1', '1', '0', '1', '1', '0', '0'},{'1', '1', '1', '1', '0', '1', '1', '0', '1'},{'1', '1', '1', '1', '0', '1', '1', '1', '0'},{'1', '1', '1', '1', '0', '1', '1', '1', '1'},{'1', '1', '1', '1', '1', '0', '0', '0', '0'},{'1', '1', '1', '1', '1', '0', '0', '0', '1'},{'1', '1', '1', '1', '1', '0', '0', '1', '0'},{'1', '1', '1', '1', '1', '0', '0', '1', '1'},{'1', '1', '1', '1', '1', '0', '1', '0', '0'},{'1', '1', '1', '1', '1', '0', '1', '0', '1'},{'1', '1', '1', '1', '1', '0', '1', '1', '0'},{'1', '1', '1', '1', '1', '0', '1', '1', '1'},{'1', '1', '1', '1', '1', '1', '0', '0', '0'},{'1', '1', '1', '1', '1', '1', '0', '0', '1'},{'1', '1', '1', '1', '1', '1', '0', '1', '0'},{'1', '1', '1', '1', '1', '1', '0', '1', '1'},{'1', '1', '1', '1', '1', '1', '1', '0', '0'},{'1', '1', '1', '1', '1', '1', '1', '0', '1'},{'1', '1', '1', '1', '1', '1', '1', '1', '0'},{'1', '1', '1', '1', '1', '1', '1', '1', '1'}};
  	for (char a[] : arr) {
     	for (char b : a) {
        	Secret.getInstance().process(b);
     	}
     	System.out.println(Secret.getInstance().getData());
     	Secret.getInstance().resetInstance();
  	}

   }
}
```

<figure><img src="https://lh7-us.googleusercontent.com/63ctC0HUIKdLYOpUV-Hlcq_WRzQ0DvimdGRNPLZ85R85ZryV40LjjeWJtzHsJLszWTys_5TM3H5bhwPR5Nt2OIHt4Ald-h471FwjbWSAfG9X7eHTXBQZ9lD4IjBznDOXKfZUeHyWitSHURJVf7trvQ" alt=""><figcaption></figcaption></figure>

Flag : COMPFEST13{brut3Force\_AND\_w1n\_6965d74c2e}

## Magical Mystery Club (482 pts)

### Description

\-

### Solution

Diberikan file ELF 64 bit, kemudian kami coba decompile

<figure><img src="https://lh7-us.googleusercontent.com/ZGXYHeZHqoeB4HcbLjQTztntxujBGVxuS8SxL-C5c-2wl102Li5LJYDVPjQ1TYvqt5azWhzCAyAV2uvyw79M0tArKmsmN-RkE0lmrfFo0yWzMtMvLZ51v4mKhWG4dM4Znz5UTieX_S56TJVyls4-5Q" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/bb-80fNkX2aCCz3sFmDAJIk4nDDv-LObNXYqY6Bv1n15Cqx4lvqKGoTTGzRz8Wjtp4fNeYURRcffTJ0OBotDQnhYRVWp2RyW6Xnt7gRUNfXoAnbYVKMvsvhmQSqHzUsFEaML_yLaz0D-J4C5PduxLw" alt=""><figcaption></figcaption></figure>

Disini kami lakukan analisis pada fungsi main dan cast magic, cast magic untuk setiap indexnya nilai nya sama , jadi antar index tidak saling bergantung , jadi bisa dibruteforce per index. Berikut solver yang kami gunakan

```python
#!/usr/bin/python3
import string

flag = ""
class SolverEquation(gdb.Command):
	def __init__ (self):
    	super (SolverEquation, self).__init__ ("solve-equation",gdb.COMMAND_OBSCURE)

	def invoke (self, arg, from_tty):
    	global flag
    	cmp_val = [0x5d, 0xed, 0x7b, 0xdc, 0xf2, 0x37, 0xdd, 0xf8, 0xf, 0x9, 0xd5, 0xfe, 0xad, 0x46, 0x83, 0xda, 0xf9, 0x68, 0x1e, 0xb7, 0x63, 0x68, 0x49, 0x7f, 0x8c, 0x48, 0x80, 0x87, 0xeb, 0xfb, 0x1, 0x9b, 0x7d, 0xd1, 0x6f, 0xc0, 0xd9, 0xe8, 0xde, 0xdb, 0x3d, 0x11, 0x13, 0xf9, 0x99, 0xae, 0xb8, 0xa, 0x9, 0x58, 0xf7, 0x4d, 0xac, 0xb4, 0x78, 0x97, 0x82, 0xb4, 0xbc, 0x8d, 0xa, 0x2d, 0x9, 0x9c, 0x8a, 0xf7, 0x69, 0xd5, 0xe8, 0xe7, 0xc4, 0xc8, 0x39, 0xce, 0x18, 0xf8, 0xaf, 0x59, 0xbd, 0x2d, 0xcc, 0x8e, 0xf7, 0xb5, 0x6c, 0x83, 0x49, 0x53, 0x80, 0xb6, 0x92, 0xb6, 0x1f, 0xda, 0x3f, 0x94, 0x43, 0x1f]
    	gdb.execute("b *0x0000555555555b50")
    	for _ in range(98):
        	for i in string.printable[:-6]:
            	f = open("data","w")
            	f.write(flag + i*(98-len(flag)))
            	f.close()
            	gdb.execute("r < data")
            	tmp = parse(gdb.execute("x/"+str(len(flag)+1)+"bx $rdi",to_string=True))
            	if(tmp[:len(flag)+1]==cmp_val[:len(flag)+1]):
                	flag += i
                	break
    	print("z",flag)
def parse(f):
	f = f.split("\n")
	result = []
	for i in f:
    	tmp = i.split("\t")
    	for j in range(1,len(tmp)):
        	result.append(int(tmp[j],16))
	return result
def addr2num(addr):
	try:
    	return int(addr)&0xff  # Python 3
	except:
    	return long(addr) # Python 2
SolverEquation()
```

Flag bisa dilihat pada file data atau tunggu sampai selesai script berjalan

<figure><img src="https://lh7-us.googleusercontent.com/fvOyTCoDApNIaQokRxKJQTCoMdL7b3d2y1WOVeLcOtqzErk6PzIf0BcaiLC5b2I7Apli5gt09F4T09KAPZ_RjMgYD-RnbAc0d7SoYKZn9llvp2DeKMZHS-lMESQQYeBvFoHf5R7L992Iv7iUbE6lNQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/qEYFtXe-uyKYs4WG_D_zkLZTJD-xDKwsYlaDkJ3L2Yx07bY3vrpQ_7oQ79x1wES0qXmToTf8ffIETbmqRHx2vouno-sw9BEkjto6bxeL6p1HG7V6avvPySqrGjYTfP1Yi-mp2LJ8wXDET_8j2Tj2Vw" alt=""><figcaption></figcaption></figure>

Flag : COMPFEST13{n3Ver\_Tru5t\_M4tHemAg1cKal\_tR1cK5s\_n0BoDY\_tH0u6hT\_No\_0ne\_W0ulD\_n0t1c3\_4nYw4Y\_98f66ab185}

## Pave The Way (494 pts)

### Description

\-

### Solution

Diberikan file jar , disini kami lakukan extract terhadap file jar tersebut. Nama filenya mirip yaitu diawali dengan c dan diikuti dengan angka, untuk mencari file mainnya ( entry point ) kita bisa liat di manifest.

<figure><img src="https://lh7-us.googleusercontent.com/vUfAW1JIc6OyurdZNdPva0__ljxFkVOGntR_uXawz0TEGQYf4ZC_Ufr7U2AwobsMZB5RYKNmVAHSnOcrBSbvFdHuQYpqRWMUDausU5Dvp5xi9BhTcA-VJt5zAbH_2JHdAMrwqn4QsKq7D3EbIqbvBw" alt=""><figcaption></figcaption></figure>

Diketahui main classnya yaitu c239 , lakukan compile pada c239 maka class lain yang dipanggil akan ikut tercompile juga

<figure><img src="https://lh7-us.googleusercontent.com/LHZ8DWH8svYBgKHouYCwo_D_onpaj_nEdHr7K5e5of3AzWvKbADUIm0Xgrhluyk_bhIVX4RFgTedIuWbKM782Y-wRceUkPrD_eC2jVMLz6WUnh2zIJguxGD6SkH-NKmQL4CNuVvbBbIjwo7jzlnj7A" alt=""><figcaption></figcaption></figure>

Karena di file aslinya tidak ada print terhadap nilai flag maka kita perlu cari tahu di class mana method terakhir dipanggil. Caranya karena kita tahu nilai akhir flag adalah “}” lakukan search pada file yang menambahkan “}” pada variable object.

<figure><img src="https://lh7-us.googleusercontent.com/nGLUkKWIVy8fxxjKGzMUlRN5RpJcNnRkZK9QGaDo3ai4oX_zSdVkE_sJrdkSrBkXwzyH06z_Bhxd0Q-klhLgF4hVPliPcKIWoamDIBi4OLl64-MvAZvpF3AD7YNQnBiciiMmGLp2uSpb4_M_GICfRA" alt=""><figcaption></figcaption></figure>

Ambil nama filenya , lalu lakukan perbandingan dengan file class tadi.

```python
import glob
a = glob.glob("*.class")
b = ['c243','c32','c321','c375','c406','c522','c752','c756']
for i in b:
    if(i+".class" in a):
   	 print i
```

Didapatkan class terakhir yang diakses

<figure><img src="https://lh7-us.googleusercontent.com/MBCH-UO_u-8YKwK1iIdPKkydfA5HZYA5tJUsIkny6efxkrJ--WKvBEy70FDcSiNlALzAbUT4Oigj5R67oH3Sy7-AMSGUBULoJFtPiKKBW3IcQxDF3ZyVQysCHPQIT0uBwGvLy2GJLSaJLDv1XGRGVg" alt=""><figcaption></figcaption></figure>

Lakukan edit terhadap file tersebut yaitu dengan menambahkan print terhadap variable object

```java
class c375 {
	c375() {
	}

	public static void main(String[] arrstring) throws Exception {
    	System.out.print("Paving your way.");
    	c375.pave("");
	}

	public static void pave(String object) throws Exception {
    	object = (String)object + "}";
    	System.out.print(".");
    	Thread.sleep(2L);
    	System.out.println(object);
    	System.out.println("\nDone!");
	}
}
```

Disini kami sudah melakukan rewrite terhadap semua thread sleep menjadi 2 milisecond , entah kenapa ingin menulis 2 daripada 1 atau menghapusnya. Tapi 2 sudah termasuk sangat cepat. Selanjutnya compile file c375 lalu run kembali file c239 untuk mendapatkan flagnya

<figure><img src="https://lh7-us.googleusercontent.com/BoJY9JwqrxeXMzcCO60VpvWtMbWX7VaomfvemQENrv_-hzgxRHJqNI3I4wvJE4bRq8cpLCZx4qWAs8EFH6nfOjUQrR_w94HZPwAlangxRWg0uruoj7q09VhSnVNZusO0No7ZXbUl8ReO9Wu2PkVLCg" alt=""><figcaption></figcaption></figure>

Flag : COMPFEST13{MaNiFeSt\_file\_15\_ImpOrtAnt\_4\_jar\_bafc2b182e}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kos0ng.gitbook.io/ctfs/write-up/2021/compfest-quals/reverse-engineering.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
