← all posts

· 3 min read · by Eav Puthcambo

Skipping a 6-day puzzle by emulating the last 3 numbers

An ARM64 Mach-O crackme gates its flag behind a dozen conditions across six in-game days. The flag builder only reads three small integers, so you can emulate it and ignore the puzzle entirely.

Dog Simulator, BroncoCTF 2026 (reversing)

If you can survive 6 dog-days of walkies, tricks, and zoomies, you might uncover a secret (if you can stick to the right routine in the right order)!

It's an ARM64 Mach-O binary, stripped, and much heavier than its "Cat Simulator" predecessor. Six actions per day (Bark, Fetch, Sit, Eat, Zoomies and a free-text Speak), tracked across a pile of running counters: score, bond, mood, per-action counts, and two rolling hashes.

The giant AND

Disassembling __text (resolving ARM64's adrp+add string loads so the prompts show up inline) reveals the structure: a six-day loop, then a long chain of conditional compares that act as one enormous && gating the flag:

bond_hash == 1 && fetch_count == 1 && eat_count == 2 && mood == 2 &&
score == 0x37 && last_action == Eat && speak_letters == 19 &&
bark_count == 24 && energy > 20 && bond > 2 && combo_flag == 1 &&
action_hash == 0x740a8a98 && speak_hash == 0xf5d38524

plus a hardcoded check that the Speak text equals "gremlin" (the dog's nickname from the intro). Solving that whole combo puzzle by hand, twelve conditions across six days of six choices each, is a big error-prone search.

The shortcut

But I don't have to. Past all those gates, the flag builder is a small, self-contained block, and it only consumes three small integers:

  • w22 — final mood (0–3)
  • w25 — final bond (pinned to 24 by the gate)
  • w26 — final energy

It runs them through a vectorized murmur3-style hash across NEON lanes to make a 24-byte keystream, then XORs that against stored constants to produce the flag. That's small enough to just run.

Emulate the builder directly

I mapped the Mach-O into Unicorn (the ARM64 emulator), set up a stack, and called straight into the flag-builder with those three registers as free variables:

def run(w22, w25, w26):
    mu.reg_write(UC_ARM64_REG_W22, w22)
    mu.reg_write(UC_ARM64_REG_W25, w25)
    mu.reg_write(UC_ARM64_REG_W26, w26)
    mu.emu_start(0x100000ee8, 0x1000011dc)
    return bytes(mu.mem_read(x29 - 0xe0, 24))

Then I swept small ranges of all three and kept whichever output decoded to printable ASCII. Garbage inputs make garbage bytes, so the right state stands out instantly:

$ python solve_dog_emulate.py
w22=0 w25=20 w26=2 -> b'bronco{mans_best_friend}'

A couple of different triples land on the same flag, because the hash collides in such a tiny search space, which is fine. The point is I never had to work out the six-day routine at all. When the hard part feeds a small, isolated function, emulating that function beats solving the puzzle that leads to it.

📂 Full writeup with the disassembler and the Unicorn solver: ctf-writeups/reverse/…/dog simulator

Thanks for reading! Questions or corrections? Ping me on GitHub.

Read more

all posts →