File comparisons
Results 1 to 4 of 4

Thread: File comparisons

  1. #1

    File comparisons

    I'd like to compare two files, for sake of explanation we can say that they are two executables, one patched, one isn't. I'm looking for a tool that will compare the hex in both and highlight the differences automatically. I'm hoping someone out there has a hex editor with that feature, or knows of a tool that does it. I've always wanted something like this, right now I need it to test a watermark in a photo...


  2. #2
    Senior Member nihil's Avatar
    Join Date
    Jul 2003
    United Kingdom: Bridlington
    Hi Soda~

    You might like to look at this:

    "Beyond Compare"

    Sorry, I don't know of any free ones

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Hey Hey,

    I'm a big fan of Hackman Hex Editor... It has a compare feature

    Purpose: You can perform a binary comparison between two (of the) logged files. You can search not only for differences but also for equal strings.
    Load two or more files in Hackman Hex Editor and select Compare under the Tools menu. The dialog box will pop-up and then you have to select two of the logged files that should be compared.
    The lite version is the only free one however, the others are 24.99 and 49.99 each, however this is the first time I've seen this, I have a slightly older version that is fully functional and free. --

    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  4. #4
    Senior Member
    Join Date
    Mar 2004
    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).

    #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);
     while(!( (fin1.eof()) || (fin2.eof())  )){
    	 for (i=0;i<1024;i++) { buf1[i]=0;buf2[i]=0; }
 [0], sizeof(buf1));[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]);
     printf("A total of %d differences found.\n",err);
     return 0;
    compile with any environment or
    > g++ -o bindiff bindiff.cpp
    and use it

    > ./bindiff file1 file2

    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts