As part of a class project I need to write an exploit for the read below:
unsigned char data[200];
int i,j,n;
n=open(filename, O_RDONLY);
i=-1;
do{
i++;
j=read(n,data+i,1);
}while(j>0);
I have the binary code for NOP/open a shell/etc, but I can't figure out how to store it correctly in data since I have to read from a file - It ends up stored as ascii characters, having different values from what I need.
Any help would be appreciated.