]> granicus.if.org Git - file/commit
Use signed offsets to reduce false positives (Christoph Biedl)
authorChristos Zoulas <christos@zoulas.com>
Wed, 20 Jul 2016 11:28:40 +0000 (11:28 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 20 Jul 2016 11:28:40 +0000 (11:28 +0000)
commit660fef8056282943055c9e2f56f9b877ff9b0591
tree55727f696b2fea538d892281831df21deaeb594f
parent558649d66b57e365a8d2ea429db73df72bd3f0a9
Use signed offsets to reduce false positives (Christoph Biedl)

And here is your reward: Reduce the number of false-positive
detections of "DOS executable (COM)" big time, especially for small
files. In my case, modulo further checks, the number of files reported
that way went down from some 2500 to 35, with perhaps 6
false-positives.

The trick: The target of the JMP instruction at offset 0 must be valid
and sound: For 0xeb (8bit offset) the offset must be positive as
negative offsets would lead into the program segment prefix (PSP), and
the file must be long enough that jump target actually exists. Similar
for 0xe9 (16bit offset). Here negative offsets (wrapped around at
16bit) are acceptable as long as they don't lead into the PSP. Such
files do exist. And that's where I needed a signed indirect offset.
magic/Magdir/msdos