CRACK Solution

SUM GATE

CRACK additive checksum

In-game screenshot of SUM GATE
In-game view
FamilyCRACK Graph0.254 DifficultyEasy Ring02 IDt06_adder

Prerequisites

LADDER DOWN

Unlocks

Silent Entry

Accepted input ABCD
Techniqueadditive checksum Rulenonzero SampleABCD

Walkthrough

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

Verifier Listing
; t06_adder: 4-byte input. Sum of the bytes (mod 256) must equal 0x0A.
; Technique: additive checksum / sum gate. Excellent early constructive+decode mix
; (pairs directly with WORM ADD and REPEATER tickets). r0 = 1 on accept.
; Accept rule: nonzero.
;
; Example solution: any 4 bytes whose sum mod 256 is 0x0A (e.g. "ABCD",
; 65+66+67+68 = 266 = 0x10A, low byte 0x0A).

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

        mov   r0, 0
        mov   r7, 0
        ldb   r2, [r7]
        add   r0, r2
        inc   r7
        ldb   r2, [r7]
        add   r0, r2
        inc   r7
        ldb   r2, [r7]
        add   r0, r2
        inc   r7
        ldb   r2, [r7]
        add   r0, r2

        cmp   r0, 0x0A  ; ABCD sums to 266 (0x10A) -> low byte 0x0A
        jnz   bad

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