File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 8686 archive .Z (),
8787 archive .Lzop (),
8888 archive .Lz (),
89+ archive .Elf (),
8990 archive .Lz4 (),
9091)
9192
Original file line number Diff line number Diff line change @@ -540,6 +540,27 @@ def match(self, buf):
540540 buf [3 ] == 0x50 )
541541
542542
543+ class Elf (Type ):
544+ """
545+ Implements the Elf archive type matcher
546+ """
547+ MIME = 'application/x-executable'
548+ EXTENSION = 'elf'
549+
550+ def __init__ (self ):
551+ super (Elf , self ).__init__ (
552+ mime = Elf .MIME ,
553+ extension = Elf .EXTENSION
554+ )
555+
556+ def match (self , buf ):
557+ return (len (buf ) > 52 and
558+ buf [0 ] == 0x7F and
559+ buf [1 ] == 0x45 and
560+ buf [2 ] == 0x4C and
561+ buf [3 ] == 0x46 )
562+
563+
543564class Lz4 (Type ):
544565 """
545566 Implements the Lz4 archive type matcher.
You can’t perform that action at this time.
0 commit comments