> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/reverse-engineering/quantum-scrambler.md).

# Quantum Scrambler

i used this py script,

```python
#!/usr/bin/env python3

from pwn import *
import ast

host = "verbal-sleep.picoctf.net"
port = 56726

# connect to remote service
conn = remote(host, port)

# receive all data (list of encoded values)
hex_value = conn.recvall()

# convert bytes → string → python list
list_hex = ast.literal_eval(hex_value.decode())

flag = ""

# decode logic
for i in list_hex:
    if len(str(i)) == 4:
        flag += chr(int(i / 16))

print(flag)
```

When we connect to the challenge using:

```bash
nc verbal-sleep.picoctf.net 56726
```

we receive a large list of numbers (looks like “shitty hex values”, but actually integers).

* The values are **not actual hex**, but decimal numbers
* Most values are **4 digits long**
* Converting them directly to ASCII doesn’t work

So we try transformations.

For 4-digit values:

```
value / 16 → ASCII
```

Example:

* `1456 / 16 = 91` → `[`
* Continue → forms readable characters

1. Connect to server using pwntools
2. Receive the list of numbers
3. Convert it into a Python list using `ast.literal_eval()`
4. Loop through values
5. Divide by 16
6. Convert to ASCII using `chr()`
7. Build the flag

The decoded output gives the flag:

```
picoCTF{...}
```


---

# 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://alham-rizvi.gitbook.io/alhamrizvi/picoctf-writeups/picoctf/reverse-engineering/quantum-scrambler.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.
