Created
October 26, 2013 21:27
-
-
Save joshenders/7174765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void fill(unsigned char* addr, size_t amount) { | |
unsigned long i; | |
for (i = 0; i < amount; i++) { | |
*(addr + i) = 42; | |
} | |
} | |
int main(int argc, char **argv) { | |
unsigned char *result; | |
char input; | |
size_t size = 1<<30; | |
result = malloc(size); | |
printf("Addr: %p\n", result); | |
fill(result, size); | |
scanf("%c", &input); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment