}
srand48(time(NULL));
- while (1) {
- printf("Press enter to read a random byte of memory. (pid %d) >", pid);
- while (getchar() != '\n');
+ int *pi;
+ do {
uint32_t lower = lrand48();
uint32_t upper = lrand48();
// align to integer, keep in "userspace" address space
pvalue &= 0x00007FFFFFFFFFF0;
- int *pi = (void*)(pvalue);
+ pi = (void*)(pvalue);
printf("*%p = ", (void*)pi);
printf("%x\n", *pi);
- }
+ } while (*pi == 0);
}