[File] [E] Re: How to detect go mac executables with magic.h?

Guy Harris gharris at sonic.net
Wed May 26 00:05:49 UTC 2021


On May 25, 2021, at 5:00 PM, Guy Harris <gharris at sonic.net> wrote:

> ubu20-04$ file --mime-type /tmp/cat
> /tmp/cat: application/x-mach-binary
> magic file from /etc/magic:/usr/share/misc/magic
> ubu20-04$ file -i --mime-type /tmp/cat
> /tmp/cat: application/x-mach-binary; charset=binary
> ubu20-04$ file -i /tmp/cat
> /tmp/cat: application/x-mach-binary; charset=binary

And, for a non-fat Mach-O binary, running the same version of file on Ubuntu 20.04:

ubu20-04$ scp {my Mac host}:~/src/cmd/tcpdump.org/work/tcpdump/tcpdump /tmp
Password:
tcpdump                                       100% 1187KB  65.1MB/s   00:00    
ubu20-04$ file /tmp/tcpdump
/tmp/tcpdump: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE>
ubu20-04$ file -i /tmp/tcpdump
/tmp/tcpdump: application/x-mach-binary; charset=binary
ubu20-04$ file --mime-type /tmp/tcpdump
/tmp/tcpdump: application/x-mach-binary
ubu20-04$ file -i --mime-type /tmp/tcpdump
/tmp/tcpdump: application/x-mach-binary; charset=binary



More information about the File mailing list