#define HAVE_LARGEFILE_SUPPORT #define _FILE_OFFSET_BITS 64 #define _LARGEFILE_SOURCE #include #include int main(int argc, char ** argv){ unsigned char buf[1024]; unsigned long int c=0; FILE *fp; FILE *fpo; if(argc!=3){ printf("Syntax: ./xorme source dest\n"); exit(1); }; fp=fopen(argv[1],"r"); fpo=fopen(argv[2],"w"); c=0; while(1){ if(fread(buf,512,1,fp)!=1){ printf("sector: %lx: err(eof?) while reading\n",c); exit(2); }; *((unsigned long int*)buf) ^= c; if(fwrite(buf,512,1,fpo)!=1){ printf("sector: %lx: err(:-/) while writing\n",c); exit(2); }; c++; }; return(0); };