> 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/bbbbloat.md).

# bbbbloat

### Challenge Writeup

The program prompts the user with:

```
What's my favorite number?
```

#### Step 1: Static Analysis in Ghidra

Open the binary in **Ghidra** and let it analyze the file.

Navigate to:

```
Window → Defined Strings
```

From the list of strings, locate:

```
"What's my favorite number?"
```

#### Step 2: Cross References

Click on the string and view its **cross references (XREF)**. This leads to the function where the string is used (likely the `main` function).

#### Step 3: Decompilation

In the decompiler view, the logic becomes clear:

* A variable (e.g., `local_48`) stores user input.
* The program compares this input against a hardcoded value:

  ```
  0x86187
  ```

#### Step 4: Convert Hex to Decimal

Convert the hexadecimal value:

```
0x86187 = 549255
```

#### Step 5: Run the Program

Provide the correct input:

```
./bbbbloat
What's my favorite number? 549255
```

#### Step 6: Flag

The program returns the flag:

```
picoCTF{cu7_7h3_bl047_36dd316a}
```

***

### Final Answer

* Favorite number: **549255**
* Flag: **picoCTF{cu7\_7h3\_bl047\_36dd316a}**


---

# 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/bbbbloat.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.
