|
-
April 4th, 2005, 02:34 AM
#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...
Thanks!
-
April 4th, 2005, 02:53 AM
#2
Hi Soda~
You might like to look at this:
http://www.scootersoftware.com/
"Beyond Compare"
Sorry, I don't know of any free ones
-
April 4th, 2005, 05:05 AM
#3
Hey Hey,
I'm a big fan of Hackman Hex Editor... It has a compare feature
Compare
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. -- http://www.technologismiki.com/en/index-h.html
Peace,
HT
-
April 4th, 2005, 06:59 AM
#4
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).
Code:
#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;
}
compile with any environment or
Code:
> g++ -o bindiff bindiff.cpp
and use it
Code:
> ./bindiff file1 file2
Cheers.
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
-
Forum Rules
|
|