# Day 19

#### Task 25 — Game hacking Day 19: I merely noticed that you're improperly stored, my dear secret! <a href="#daec" id="daec"></a>

**1. What is the OTP flag?**

1. Start your machine.
2. Open the TryUnlockMe folder, right-click and open a terminal inside that folder.
3. Enter the following command, `frida-trace ./TryUnlockMe -i 'libaocgame.so!*'`
4. Now, Navigate to `/home/ubuntu/Desktop/TryUnlockMe/__handlers__/libaocgame.so/`
5. Open the `_Z7set_otp.js` file or a file with `set_otp` keyword.
6. Modify the code as below and interact with the game.

```perl
CopydefineHandler({
  onEnter(log, args, state) {
    log('_Z7set_otpi()');
    log("OTP:" + args[0].toInt32());
  },
  onLeave(log, retval, state) {
  }
});
```

7\. Now, see the terminal an OTP number will be displayed, paste that in the game to get the flag.

```css
CopyAns: THM{one_tough_password}
```

**2. What is the billionaire item flag?**

Open and modify the purchase file as below, interact with the game and try to purchase the flag.

```perl
CopydefineHandler({
  onEnter(log, args, state) {
    log('_Z17validate_purchaseiii()');
    args[1] = ptr(0)

  },

  onLeave(log, retval, state) {
      
  }
});
Ans: THM{credit_card_undeclined}
```

**3. What is the biometric flag?**

Modify the Biometric file with the below one and interact with level 3

```perl
CopydefineHandler({
  onEnter(log, args, state) {
    log('_Z16check_biometricsPKc()');
    log("PARAMETER:" + Memory.readCString(args[0]))
  },

  onLeave(log, retval, state) {
    retval.replace(ptr(1))
  }
});
Ans: THM{dont_smash_your_keyboard}
```


---

# Agent Instructions: 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:

```
GET https://foothold.gitbook.io/blog/advent-of-cyber-2024/day-19.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
