I’m trying to write some basic ARM shell code that loads up the r0 register with 0. I cannot use null characters. I can see that
subs r2, r2, r2
sets r2 to 0 without using any null bytes.
However, any attempts to move r2 to r0, results in shell code that uses null bytes. Any advice on what I could do?
push r2
andpop r0
? IIrc, the register sets to be pushed and popped are bitfields in these instructions. If this doesn't work, maybe something likepush r2,r3
thenpop r0,r3
works.push {r2.r8}; pop{r0,r8}
which assembles to02 20 52 e0 04 01 2d e9 01 01 bd e8
.