[net.unix-wizards] executable file diff

jpage@rruxe.UUCP (J. H. Page) (09/11/85)

any unix-wizard out in net land ever come up with a reliable(workable)
way to compare(diff) two executables presumably compiled from the same
src???

i'm running SV.0.5 on 780's and 3B20's.

thanks for your help,

jim page


also any ideas on how to compare .o files as well???

levy@ttrdc.UUCP (Daniel R. Levy) (09/12/85)

Please pardon me for posting.  I am having difficulty trying to reach pyuxww
from here (apparently my closest link on this path, via ihnp4) so I post
instead of mail.

To: ltuxa!mgnetp!ihnp4!mhuxn!mhuxr!ulysses!gamma!pyuxww!pyuxv!rruxa!rruxe!jpage
Subject: Re: executable file diff
In-reply-to: your article <289@rruxe.UUCP>

In article <289@rruxe.UUCP>, jpage@rruxe.UUCP (J. H. Page) writes:
>any unix-wizard out in net land ever come up with a reliable(workable)
>way to compare(diff) two executables presumably compiled from the same
>src???
>i'm running SV.0.5 on 780's and 3B20's.
>thanks for your help,
>jim page
>also any ideas on how to compare .o files as well???

No wizard I, but methinks this is not a tough task.

If you are just interested in knowing if they are the same or not (without
wanting to know WHAT is different) first check the obvious--are they the same
size (as told by ls -l at first, then via the size command)?  Warning--if one
of the files is "stripped" and the other is not (use the "file" command to
determine this) make a stripped copy of the one that is not and use that to
compare with the other.   This test passed, try the "sum" command on both
the files which should come up with identical checksums if they are the same.
If you are REALLY paranoid, do an "od" on each one, save the results, and do
a conventional "diff" between those results.

This could obviously be put into a little shell script by anyone who cared to.
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer, my pets, my plants, my boss, or the
| at&t computer systems division |  s.a. of any computer upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!ihnp4!ttrdc!levy
                                      or: ..!ihnp4!iheds!ttbcad!levy

mfs@mhuxr.UUCP (SIMON) (09/13/85)

> If you are just interested in knowing if they are the same or not (without
> wanting to know WHAT is different) first check the obvious--are they the same
> size (as told by ls -l at first, then via the size command)?  Warning--if one
> of the files is "stripped" and the other is not (use the "file" command to
> determine this) make a stripped copy of the one that is not and use that to
> compare with the other.   This test passed, try the "sum" command on both
> the files which should come up with identical checksums if they are the same.
> If you are REALLY paranoid, do an "od" on each one, save the results, and do
> a conventional "diff" between those results.
> 
>         dan levy 

You could also use the cmp(1) command, which does a byte by byte compare
of the two files. Sounds easier to me.

Marcel Simon

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (09/14/85)

> any unix-wizard out in net land ever come up with a reliable(workable)
> way to compare(diff) two executables presumably compiled from the same
> src???

The real question is, just what are you trying to find out?

If the code was developed right, you can just run "what" on it
to find out what source code versions were used.

tim@cithep.UucP (Tim Smith ) (09/18/85)

>>  any unix-wizard out in net land ever come up with a reliable(workable)
>>  way to compare(diff) two executables presumably compiled from the same
>>  src???
>
> The real question is, just what are you trying to find out?
>
> If the code was developed right, you can just run "what" on it
> to find out what source code versions were used.

If they have a UniSoft port, they could be trying to find out why it is not
possible to compile their sources, and get binaries that are the same size as
the ones UniSoft distributes ( assuming, of course, that the program is one
which UniSoft source is legal C code, say, something other than vi. )
-- 
unlk	a6
rts
					Tim Smith
				ihnp4!{wlbr!callan,cithep}!tim