CTF Challenge: ARMssembly 0

November 27, 2025 PicoCTF Medium

Challenge Overview:

  • This was the following description for the challenge.

Challenge screenshot

  • There are definitely, many ways that this challange can be solved.
  • The most straight forward way is:

Prerequisites

  • Install the compiler and the emulator (qemu):
    sudo apt install qemu-user-static && gcc-aarch64-linux-gnu
    
  • From here we can just compile the binary and pass the arguments then get the value, but let us attempt to understand assembly:

Static Analysis

Challenge screenshot

  • Looking at the assembly: Challenge screenshot
    • We see that initially the 1st argument “182476535” is stored in w0 but later it is found in w1.
    • Same with the 2nd argument “3742084308”, it is first stored in w1 but later it is found in w0
    • Meaning the final results are: w0 = 3742084308; w1 = 182476535.
    • So when the cmp instruction gets executed; the first argument w1 is checked if it less than second argument w0, and if true then the program will jump to .L2, for which it is true.
    • Then we see that .L2 returns the second argument “3742084308”, which is our answer.

Through Compilation

Challenge screenshot