We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c26baf8 commit c118951Copy full SHA for c118951
filetype/types/__init__.py
@@ -77,6 +77,7 @@
77
archive.Ar(),
78
archive.Z(),
79
archive.Lz(),
80
+ archive.Elf(),
81
)
82
83
# Expose supported type matchers
filetype/types/archive.py
@@ -513,3 +513,24 @@ def match(self, buf):
513
buf[1] == 0x5A and
514
buf[2] == 0x49 and
515
buf[3] == 0x50)
516
+
517
518
+class Elf(Type):
519
+ """
520
+ Implements the Elf archive type matcher
521
522
+ MIME = 'application/x-executable'
523
+ EXTENSION = 'elf'
524
525
+ def __init__(self):
526
+ super(Elf, self).__init__(
527
+ mime=Elf.MIME,
528
+ extension=Elf.EXTENSION
529
+ )
530
531
+ def match(self, buf):
532
+ return (len(buf) > 52 and
533
+ buf[0] == 0x7F and
534
+ buf[1] == 0x45 and
535
+ buf[2] == 0x4C and
536
+ buf[3] == 0x46)
0 commit comments