Skip to content

Commit dac9381

Browse files
committed
fix(pe): Erratic driver identification
Prevent false positives such as ntdll.dll because it has the PAGE section which is driver-typical.
1 parent 1b6c87e commit dac9381

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/pe/parser.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ func parse(path string, data []byte, options ...Option) (*PE, error) {
407407
// driver samples may not contain an import directory, but section names may
408408
// reveal the PE is a kernel driver.
409409
func (pe *PE) isDriver() bool {
410+
// Prevent false positives such as ntdll.dll
411+
// because it has the PAGE section which is
412+
// driver-typical
413+
if pe.IsDLL {
414+
return false
415+
}
410416
// DIRECTORY_ENTRY_IMPORT may exist, although it may be empty.
411417
// If it imports from "ntoskrnl.exe" or other kernel components it should
412418
// be a driver.

0 commit comments

Comments
 (0)