> 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/binary-instrumentation-1.md).

# Binary Instrumentation 1

I started by analyzing the given Windows executable using `rabin2` to inspect its sections:

```bash
rabin2 -S bininst1.exe
```

This showed standard PE sections like `.text`, `.rdata`, `.data`, `.rsrc`, and `.reloc`.

Next, I used `binwalk` to check for embedded files inside the binary:

```bash
binwalk bininst1.exe
```

It detected:

* A PE executable
* An XML manifest
* LZMA compressed data

Then I extracted the contents using:

```bash
binwalk -e bininst1.exe
```

Inside the extracted folder, I found a file (`6000`) which contained mostly binary garbage. I used `strings` on it to search for readable content:

```bash
strings 6000
```

Among system strings and function names, I found a clear message:

> "Hi, I have the flag for you just right here! I'll just take a quick nap before I print it out for you... Ok, I'm up! The flag is: cGljb0NURnt3NGtlX20zX3VwX3cxdGhfZnIxZGFfZjI3YWNjMzh9"

This looked like Base64 encoding, so I decoded it:

```bash
echo "cGljb0NURnt3NGtlX20zX3VwX3cxdGhfZnIxZGFfZjI3YWNjMzh9" | base64 -d
```

Final flag:

```
picoCTF{w4ke_m3_up_w1th_fr1da_f27acc38}
```


---

# 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/binary-instrumentation-1.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.
