comparing binary files for finding same values

Not about OpenMW? Just about Morrowind in general? Have some random babble? Kindly direct it here.
Post Reply
User avatar
Posts: 229
Joined: 18 Sep 2014, 21:20

comparing binary files for finding same values

Post by asmo » 02 Mar 2016, 13:36


I need to locate specific positions that contain values in binary files which are shared by all those files. I wrote a shell script that converts 00b to '00'-string and so on and then compares those strings.
Unfortunately an 1:1 comparison does not do the job because entries are often shuffled.
an example:

Code: Select all

fileA    date1 hellohello date2
fileB    date1 date2 hellohello
fileC    hellohello date2 date1
Obviously comparing the first byte of fileA and fileB will result in b_equal=true. Comparing fileC then will result in b_equal=false although all files contain "date1".

Kompare (using files that contain the string representation), wxHexEditor and okteta (binary files) don't help.

Any idea what I can do here? Is there a tool to do that?
How did you figure out the structure of the Morrowind data files - e.g. of mod files?
Thanks in advance!


PS: I really don't know much about the structure of those files. There are strings in those files that might be keys/variable_names but it seems to me that the associated values are saved as binary values, so 5 becomes 0x05 which is equal to 0101b. And probably it's not stored like key:value but "key1 key35 key2" because I couldn't find any "fitting" values closeby so they might be somewhere else.
I can create such files (by a program that I did not make) and I tried to find equal values in order to find a structure or such but I failed so far.

In the worst case the values in the files are not stored as 5 (0101b) 1 (0001) but 0x33.
gentoo Linux - rolling release

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests