> 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/forensics/advanced-potion-making.md).

# advanced-potion-making

after analyzing this file i found that the hex is wrong, its in png format but corrupted

<img src="https://github.com/user-attachments/assets/7828ddc3-a6d4-4c97-a5eb-277eaf835443" alt="image" height="768" width="1366">

after checking this, we have to fix the headers of image to get correct png file, we can use any hex editor like hexeditor, hexyl, xxd or ju8st use a python script,

<img src="https://github.com/user-attachments/assets/fb9eb381-cf79-4718-a7ee-d731773519c8" alt="image" height="600" width="791">

```
alhamrizvi@alhams-fedora:~/Downloads$ python3 -c "with open('advanced-potion-making', 'r+b') as f: f.write(bytes([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]))"
alhamrizvi@alhams-fedora:~/Downloads$ pngcheck -v advanced-potion-making
File: advanced-potion-making (30372 bytes)
  chunk IHDR at offset 0x0000c, length 1184532:  EOF while reading data
ERRORS DETECTED in advanced-potion-making
alhamrizvi@alhams-fedora:~/Downloads$ python3 -c "with open('advanced-potion-making', 'r+b') as f: f.seek(8); f.write(bytes([0x00, 0x00, 0x00, 0x0D]))"
alhamrizvi@alhams-fedora:~/Downloads$ pngcheck -v advanced-potion-making
File: advanced-potion-making (30372 bytes)
  chunk IHDR at offset 0x0000c, length 13
    2448 x 1240 image, 24-bit RGB, non-interlaced
  chunk sRGB at offset 0x00025, length 1
    rendering intent = perceptual
  chunk gAMA at offset 0x00032, length 4: 0.45455
  chunk pHYs at offset 0x00042, length 9: 5669x5669 pixels/meter (144 dpi)
  chunk IDAT at offset 0x00057, length 30265
    zlib: deflated, 32K window, fast compression
  chunk IEND at offset 0x0769c, length 0
No errors detected in advanced-potion-making (6 chunks, 99.7% compression).
alhamrizvi@alhams-fedora:~/Downloads$ xdg-open advanced-potion-making
```

then i figured out that the png file has nothing but just red background, i found this tool <https://www.online-image-editor.com/>

change image color > B\&w


---

# 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/forensics/advanced-potion-making.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.
