CRACK Solution

Index Offset

CRACK position subtract cipher

In-game screenshot of Index Offset
In-game view
FamilyCRACK Graph0.073 DifficultyTutorial Ring01 IDllama_sub2

Prerequisites

STAIRCASE

Unlocks

BYPASS STAGE

Accepted input DATA
Techniqueposition subtract cipher Rulenonzero SampleDATA

Walkthrough

Recover the accepted input below, then submit it to the CRACK verifier.

Reject Samples

  • DAT
  • DATAX
  • data
  • EATA
Verifier Listing
; llama_sub2: position-indexed subtract cipher. The old version folded a fixed
; subtract into the compare, so it was just a literal read-off. Here the subtract
; actually RUNS and the amount is the byte's own index: input[i]: i is compared to
; a masked target, so the disassembly shows sub r0, r7 (not a constant) and the
; player must ADD each position back to recover the letter. Technique: position
; subtract cipher. r0 = 1 on accept. Accept rule: nonzero.
;
; sample "DATA": (input[i]: i) & 0xFF == target[i].

        len   r1
        cmp   r1, 4
        jnz   bad           ; exactly 4 bytes

        mov   r7, 0
        ldb   r0, [r7]
        sub   r0, r7        ; minus its own index (0)
        cmp   r0, 0x44      ; 'D'
        jnz   bad
        inc   r7
        ldb   r0, [r7]
        sub   r0, r7        ; minus 1
        cmp   r0, 0x40
        jnz   bad
        inc   r7
        ldb   r0, [r7]
        sub   r0, r7        ; minus 2
        cmp   r0, 0x52
        jnz   bad
        inc   r7
        ldb   r0, [r7]
        sub   r0, r7        ; minus 3
        cmp   r0, 0x3e
        jnz   bad

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