I wrote a very simple file corruptor for fun, but to my surprise, the \"corrupted\" file ends up being smaller in size than the original.
Here is the corruption function
output = fopen(outputname, "w+");
This deletes the contents of the file, To open the file for reading and writing without deleting the contents, use mode "r+".