CRACK Solution

Index XOR

CRACK sequential XOR (key = index)

In-game screenshot of Index XOR
In-game view
FamilyCRACK Graph0.271 DifficultyEasy Ring03 IDllama_xor_seq

Prerequisites

Three Locks

Unlocks

Spin Lock

Accepted input FLOW
Techniquesequential XOR (key = index) Rulenonzero SampleFLOW

Walkthrough

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

Reject Samples

  • FLO
  • FLOWX
  • flow
  • GLOW
Verifier Listing
; llama_xor_seq: sequential XOR where the key is the byte's own index. Byte i
; is XORed with i (0,1,2,3) and compared to a stored target. XOR is self-inverse,
; so XOR each target by its index to decode. Technique: position-indexed XOR.
; r0 = 1 on accept. Accept rule: nonzero. The index lives in r7, so the rolling
; key is just the loop counter.
;
; targets = 0x46 0x4D 0x4D 0x54  (byte i ^ i)  ->  password "FLOW".

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

        mov   r7, 0         ; r7 = index = the key
loop:   cmp   r7, r2
        jge   ok            ; all four matched -> accept
        ldb   r0, [r7]
        xor   r0, r7        ; key = index
        mov   r1, r7        ; pick the expected byte for this position
        cmp   r1, 0
        jz    e0
        cmp   r1, 1
        jz    e1
        cmp   r1, 2
        jz    e2
        mov   r3, 0x54      ; position 3
        jmp   chk
e0:     mov   r3, 0x46
        jmp   chk
e1:     mov   r3, 0x4d
        jmp   chk
e2:     mov   r3, 0x4d
chk:    cmp   r0, r3
        jnz   bad
        inc   r7
        jmp   loop

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