Created
September 15, 2011 17:18
-
-
Save mmalex/1219860 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #include <stdio.h> #include <arpa/inet.h> // for htonl int main(int argc, char **argv){ unsigned int c=0,d,i,block[256]={0}; fread(block,1,1024,fopen(argv[1],"rb")); for (i=0;i<256;++i) if (c > (d=c+htonl(block[i]))) c=d+1; else c=d; block[1]=htonl(c)^0xffffffff; fwrite(block,1,1024,fopen(argv[2],"wb")); return 0; }