Closed MatejKastak closed 2 years ago
I would relax the test to something like magic.type() contains \"MS-DOS executable\"
which seems to be present in all cases. I didn't know about this discrepancy between magic_buffer()
and magic_file()
, it does't make much sense to me, my expectations are that magic_file()
just reads the content of the file and passes it to magic_buffer()
.
Hi,
the following condition in tests fails: https://github.com/VirusTotal/yara/blob/ee6b2363f7d3bcb6b6bbe655ad8a71a451cc3af8/tests/test-magic.c#L26
because
file
identifies binary differently on different systems:Centos7
Arch linux
:question: In this output we can also see that the results differ from each other. The data in buffer is identified differently to data extracted to a file. I found that this might be caused by libmagic (see relevant part of their man page).
There are maybe two questions:
magic_buffer()
function inmagic.c
module, so the results of thefile
command and yara output might be differentSolution?
PE32_FILE
fromblob.h
in tests to something more reliable (maybe a new binary?) but I am not sure if this would work for allfile
versionsRepro
run with:
Output