daily pastebin goal
43%
SHARE
TWEET

simplecrypt.c

a guest Jan 27th, 2012 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Simplecrypt - Simple Gmail file obfuscator. Public domain.
  2.  * Use for executable attachments or archives containing executables.
  3.  * Written in 2012 by Kirn Gill II <segin2005@gmail.com>
  4.  * Idea by Mattis Michel <sic_zer0@hotmail.com>
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <unistd.h>
  9. #include <stdlib.h>
  10.  
  11. int main(int argc, char *argv[]) {
  12.         FILE *fd, *fd2;
  13.         char a;
  14.         if(argc < 2) {
  15.                 fprintf(stderr, "Not enough arguments!\n");
  16.                 exit(1);
  17.         }
  18.         if(!(fd = fopen(argv[1], "rb")) || !(fd2 = fopen(argv[2], "wb"))) {
  19.                 perror(argv[fd ? 2 : 1]);
  20.                 exit(1);
  21.         }
  22.         while(fread(&a, 1, 1, fd)) {
  23.                 a ^= 0xFF;
  24.                 fwrite(&a, 1, 1, fd2);
  25.         }
  26.         fclose(fd);
  27.         fclose(fd2);
  28.         exit(0);
  29. }
RAW Paste Data
Top