When i execute binary i want their stack segment to be filled with special data. All i do is just write program that allocate huge buffer on a stack, call a lot of malloc and mmap and for example fill all this memory with 'A' character. Then i check and see that about 80% of whole memory are used by my program. Then i stop this program and start another program that just go through the stack and check values on stack. By i don't see my 'A' character anyway. Can someone tell me how can i do it?
UPD Why i do is just because of one ctf. i mention task like.
int func()
{
int i;
if(i == 0xdeadbeef)
system("cat flag");
else
func();
}
int main()
{
func();
}