> 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/bit-o-asm-3.md).

# Bit-O-Asm-3

### Bit-O-Asm-3 — PicoCTF Walkthrough (Reverse Engineering)

Now the function actually does a small calculation. Still, the approach is the same: follow what happens to **EAX**.

The inputs (`edi`, `rsi`) are stored but never used again. The real logic starts with two constants:

```asm
mov DWORD PTR [rbp-0xc], 0x9fe1a
mov DWORD PTR [rbp-0x8], 0x4
```

So:

* `var_c = 0x9fe1a` → 654,874
* `var_8 = 4`

Next, the value is loaded into `EAX` and multiplied:

```asm
mov eax, DWORD PTR [rbp-0xc]
imul eax, DWORD PTR [rbp-0x8]
```

This gives:

```
654,874 × 4 = 2,619,496
```

Then a constant is added:

```asm
add eax, 0x1f5
```

Since:

```
0x1f5 = 501
```

Final calculation:

```
2,619,496 + 501 = 2,619,997
```

That value is returned via `EAX`.

***

### Final Answer

```
2619997
```


---

# 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/bit-o-asm-3.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.
