CTF Challenge: ARMssembly 0
Challenge Overview:
- This was the following description for the challenge.
- 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
- Looking at the assembly:
- We see that initially the 1st argument “182476535” is stored in
w0but later it is found inw1. - Same with the 2nd argument “3742084308”, it is first stored in
w1but later it is found inw0 - Meaning the final results are: w0 = 3742084308; w1 = 182476535.
- So when the
cmpinstruction gets executed; the first argumentw1is checked if it less than second argumentw0, and if true then the program will jump to.L2, for which it is true. - Then we see that
.L2returns the second argument “3742084308”, which is our answer.
- We see that initially the 1st argument “182476535” is stored in