CRACK Solution

MIRROR BITS

CRACK bit-reversal verify

In-game screenshot of MIRROR BITS
In-game view
FamilyCRACK Graph0.500 DifficultyMedium Ring03 IDm05_bitreverse

Prerequisites

ECHO SHADOW

Unlocks

PEAK HOLD

Accepted input INVERT
Techniquebit-reversal verify Rulenonzero SampleINVERT

Walkthrough

The gate flips every byte end for end, bit 0 trading places with bit 7, before it compares. Read the stored targets, mirror their bits, and the password falls out.

Each byte is bit-reversed, then matched to a target. Reverse the eight bits of each target value to recover the original character; bit reversal is its own inverse.

Hints

  • HINT 1: Length is fixed at 6. The loop rebuilds each byte one bit at a time, low bit becoming high bit.
  • HINT 2: There is no reverse op; it shifts the accumulator left, peels the source low bit, ORs it in, and shifts the source right, eight times.
  • HINT 3: Mirroring is symmetric: bit-reverse each stored target byte and you get the input byte. The six bytes spell INVERT.

Reject Samples

  • INVERS
  • invert
  • INVER
  • INVERTT
  • MIRROR
Verifier Listing
; m05_bitreverse: "Mirror Bits". Every input byte has its eight bits reversed
; (bit 0 swaps with bit 7, bit 1 with bit 6, and so on), and the mirrored byte is
; compared against a stored target at each of 6 positions. There is no single bit-
; reverse op on the core, so the check builds the reversal by hand: eight times it
; shifts the result left, pulls the low bit off the source, ORs it in, then shifts
; the source right. To crack it, mirror each target byte the same way to read the
; password back. Technique: bit-reversal verify. r0 = 1 on accept; rule: nonzero.
;
; targets are bitrev8(c) of "INVERT":
;   I=0x92 N=0x72 V=0x6A E=0xA2 R=0x4A T=0x2A

        len   r2
        cmp   r2, 6
        jnz   bad           ; fixed length 6

        mov   r7, 0         ; r7 = position index
loop:   cmp   r7, 6
        jge   ok            ; all six matched, accept
        ldb   r3, [r7]      ; r3 = source byte (consumed bit by bit)

        ; --- reverse the eight bits of r3 into r0 ----------------------
        mov   r0, 0         ; r0 = reversed accumulator
        mov   r1, 8         ; r1 = bit counter
rev:    cmp   r1, 0
        jz    sel
        shl   r0, 1         ; make room for the next bit
        mov   r4, r3
        and   r4, 1         ; r4 = current low bit of the source
        or    r0, r4        ; drop it into the accumulator
        shr   r3, 1         ; advance to the next source bit
        dec   r1
        jmp   rev

        ; --- select this position's target byte ------------------------
sel:    cmp   r7, 0
        jz    t0
        cmp   r7, 1
        jz    t1
        cmp   r7, 2
        jz    t2
        cmp   r7, 3
        jz    t3
        cmp   r7, 4
        jz    t4
        mov   r1, 0x2A      ; position 5 (T)
        jmp   chk
t0:     mov   r1, 0x92
        jmp   chk
t1:     mov   r1, 0x72
        jmp   chk
t2:     mov   r1, 0x6A
        jmp   chk
t3:     mov   r1, 0xA2
        jmp   chk
t4:     mov   r1, 0x4A
chk:    cmp   r0, r1
        jnz   bad
        inc   r7
        jmp   loop

ok:     mov   r0, 1
        ret
bad:    mov   r0, 0
        ret