MemoryOverwriter/testProgram.
sigonasr2, Sig, Sigo 0996dc4e7c Write values directly to a memory address.
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
2022-07-05 17:25:47 +00:00

21 lines
356 B
Plaintext

#include <stdio.h>
#include <unistd.h>
#include <string.h>
int main() {
char foo[] = "This is some text from proc-1";
printf("Now execute\n");
printf(" sudo ./testProgram2 %d %lx %lu\n", getpid(), (long unsigned int) foo, strlen(foo)+1);
printf("Press any key\n");
while (1) {
getchar();
printf("foo has changed to: %s\n", foo);
}
}