> For the complete documentation index, see [llms.txt](https://ctf.smithsecurity.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ctf.smithsecurity.biz/htb-cyber-apocalypse-2022/readme-1/reversing-rebuilding.md).

# Reversing - Rebuilding

This challenge starts out with a binary that we can just plug into Ghidra. Once you load it and analyze it you can see in the main function this:

![](/files/bQg5cKxcScSKfklFqw3S)

I have a little translation of what is happening in notepad in the bottom right of the photo, I was up late and rushing. Basically it was grabbing the encrypted data and key and performing an XOR to compare each character to see if the password was correct. This xor key was "human" and so we thought we had it but turns out that wasn't right as we got a bunch of garbled data. Turns out there was a little trick happening when it was run...

![](/files/SmH9FyERT5ucysuuFjVD)

It was changing the key from "humans" to "aliens". Now if you just use that as the key in CyberChef you can get the flag.

![](/files/9n7AQT2U73wiJAqeqGya)

PWNED!!


---

# 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://ctf.smithsecurity.biz/htb-cyber-apocalypse-2022/readme-1/reversing-rebuilding.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.
