Skip to content

Instantly share code, notes, and snippets.

@joshenders
Created October 26, 2013 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshenders/7174765 to your computer and use it in GitHub Desktop.
Save joshenders/7174765 to your computer and use it in GitHub Desktop.
#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