Hi Soda,
a free one![]()
funny you ask this. I actually made a very small program for this just yesterday.
It also is able to compare files of different size (it just does not care).
Since it is so simple, it does not look for "pattern matches". Something,
one could add "not so easily". Maybe I'll find the time. The program is written
as is, because I had to compare very huge files for differences (and they did
not fit the memory).
compile with any environment orCode:#include <math.h> #include <fstream> using namespace std; int main(int argc, char *argv[]){ char buf1[1024],buf2[1024]; int counter,i,err; ifstream fin1(argv[1], ios::in | ios::binary); ifstream fin2(argv[2], ios::in | ios::binary); counter=0;err=0; while(!( (fin1.eof()) || (fin2.eof()) )){ for (i=0;i<1024;i++) { buf1[i]=0;buf2[i]=0; } fin1.read(&buf1[0], sizeof(buf1)); fin2.read(&buf2[0], sizeof(buf2)); for (i=0;i<1024;i++){ if (buf1[i]!=buf2[i]){ printf("%.6d: 0x%x vs 0x%x\n",counter+i,buf1[i],buf2[i]); err++; } } counter+=1024; } fin1.close(); fin2.close(); printf("A total of %d differences found.\n",err); return 0; }
and use itCode:> g++ -o bindiff bindiff.cpp
Code:> ./bindiff file1 file2
Cheers.




Reply With Quote