Skip to main content
Challenges MCU assembly: register operations
Hardware Hard MCU assembly Solves: 10

MCU assembly: register operations

Author: CyberSamSU
Points
100

Many microcontroller firmwares obfuscate stored text (for example, a license key or a password) using simple register operations — XOR, ADD and ROL (rotate-left). This is not encryption, but an analyst seeing it in a disassembler must reverse it manually.

8-bit ROL(x, n) — shifts the bits of x to the left by n positions, and the shifted-out bits return from the right side (circular shift).

Below is the pseudo-assembly code taken from the firmware:

; R1 = kalit (XOR), R2 = siljish (ADD), R3 = aylantirish soni (ROL)
; R0 — kirish/chiqish registri
LOOP:
    LOAD  R0, [XABAR + i]   ; ochiq matn bayti
    XOR   R0, R1            ; R0 = R0 XOR R1
    ADD   R0, R2            ; R0 = (R0 + R2) mod 256
    ROL   R0, R3            ; R0 ni chapga R3 bitga aylantirish (8-bit doira)
    STORE [CHIQISH + i], R0
    INC   i
    JMP   LOOP  ; agar i < uzunlik

Constants: R1 = 95, R2 = 15, R3 = 2.

Output bytes obtained as a result of the program execution (hex, in order):

6C 94 70 94 3C 7C AC 98 94 88 A8 94

Reverse the operation: first ROR (the reverse of ROL), then subtract for ADD, then XOR again. Flag: BAYROQ{HW_MCU_<SOZ>}

Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −10 pts Log in
Hint 2 −20 pts Log in
Hint 3 −30 pts Log in
To submit a flag, log in.

First solvers

1. Абдул 08.09.2026
2. Stiv_084100 10.09.2026
3. W.o.X 17.09.2026
4. Лазиз 04.10.2026
5. testrejim 09.10.2026
6. 11111tttt 09.10.2026
7. Mirjaxon Qaxxarov 26.10.2026
8. Odam 04.11.2026
9. arcanum 11.11.2026
10. AGENT X 26.11.2026