CTF Challenge: ARMssembly 1

November 27, 2025 PicoCTF Medium

Challenge Overview:

  • This was the following description for the challenge.

Challenge screenshot

Static Analysis:

Challenge screenshot

  • To explain a few instructions:
    • First the user-input; we that it is stored in the address sp + 12.
    • wzr is a zero register.
    • lsl left shift operator «, shifts the bits of a number to the left by a specified number of positions for which in case no shift occurs because of the zero.
    • sdiv division operator /
    • To make all this make sense; we need to look at the main function as well:
      Challenge screenshot
    • The other instructions could be ignored as they are for the stack layout setup along with the prologue; i have highlighted what makes sense for us.
    • The user input argument is loaded in the w0 register and also gets compared (cmp) with zero. The logic is that if the returned value from the function is not zero; then the program will jump to .L4 where it will find the .L1 label which points to “you lose” string.
    • But if the returned value is zero; then the program jumps to .L0, which points to the “you win” strings.

The flag

Challenge screenshot