Created
January 8, 2022 03:47
-
-
Save shri-kanth/7b21d94fce5d328540c3a8e638fec1da to your computer and use it in GitHub Desktop.
This file contains 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 <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define SIZE 64 | |
void vuln(char *string) | |
{ | |
if(strlen(string) < SIZE) { | |
int target = 0; | |
char buffer[SIZE]; | |
sprintf(buffer, string); | |
if(target == 1330794330) { | |
printf("You Win! :)\n"); | |
return; | |
} | |
} | |
printf("Better Luck Next Time :P\n"); | |
} | |
int main(int argc, char **argv) | |
{ | |
vuln(argv[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
32-bit
:gcc -g formatZero.c -o formatZero_32 -m32 -fno-stack-protector
64-bit
:gcc -g formatZero.c -o formatZero_64 -fno-stack-protector