Skip to content

Instantly share code, notes, and snippets.

@boramalper
Last active August 29, 2015 14:13
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 boramalper/b0c6116ada4dd8f7e80a to your computer and use it in GitHub Desktop.
Save boramalper/b0c6116ada4dd8f7e80a to your computer and use it in GitHub Desktop.
Trying to overflow argc
#include <stdio.h>
int main(int argc, char **argv)
{
printf("argc : %d\n", argc);
printf("sizeof(argc) : %zu\n", sizeof(argc));
printf("argv[argc] == NULL: %s\n", argv[argc] == NULL ? "True" : "False");
return 0;
}
CC=gcc
CFLAGS=-Wall -Werror -pedantic -std=c99
all:
$(CC) $(CFLAGS) main.c -o main
#!/usr/bin/env python
import subprocess
subprocess.call(["./main"] + ["f"]*(2**32))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment