Add Codedump

Description (Markdown supported)
Title or filename
Code/******************************** Project: Buffer_Fuzzer Filename: Buffer_Fuzzer.c Since: Dec. 26, 2017 (Original Program) Author: TheCodeWeaver Version: 0.2 (Version 0.2 Start Date: Jan. 6, 2018) About: Creates files to fuzz software buffers. Simulates fuzz and 4 byte memory address. ********************************/ #include <stdio.h> #include <stdlib.h> //Fuzzing constants #define FUZZ "A" #define ADDRESS "BBBBBBBB" //Function to create a file and write fuzz to it void create_and_fuzz(char* file_name, int file_len); int main(int argc, char *argv[]) { //Command line arg parsing if (argc == 1) { printf("Usage: bfuzz [filename] [fuzz length]\n"); return 1; } else if (argc == 3) { printf("[+] Creating and fuzzing file...\n"); create_and_fuzz(argv[1], atoi(argv[2])); printf("[+] Fuzzing finished!\n"); printf("Goodbye.\n"); return 0; } else { printf("Usage: bfuzz [filename] [fuzz length]\n"); return 1; } //End of if else if else statement return 0; } //End of main function //create_and_fuzz function void create_and_fuzz(char* file_name, int file_len) { //Variables FILE* fp; //Open the file and fuzz it fp = fopen(file_name,"w+"); //Write fuzz to file for (int i = 0; i < file_len; i++) { fprintf(fp, "%s", FUZZ); } //End of for loop //Write address to file fprintf(fp, "%s", ADDRESS); fclose(fp); return; } //End of create_and_fuzz function