File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2008,6 +2008,36 @@ def elfs(self):
2008
2008
| Q (file_type__icontains = "shared object" )
2009
2009
)
2010
2010
)
2011
+
2012
+ def win_exes (self ):
2013
+ """
2014
+ Resources that are ``files`` and their filetype contains "for ms windows" or
2015
+ starts with "pe32".
2016
+ Keep sync with the content type implementation at ``typecode.contenttype``.
2017
+ """
2018
+ return (
2019
+ self .files ()
2020
+ .filter (
2021
+ Q (file_type__icontains = "for ms windows" ) | Q (filetype_file__istartswith = 'pe32' )
2022
+ )
2023
+ )
2024
+
2025
+ def mach_os (self ):
2026
+ """
2027
+ Resources that are ``files`` and their filetype contains "for ms mach-o" or
2028
+ contains "application/x-mach-binary".
2029
+ Keep sync with the content type implementation at ``typecode.contenttype``.
2030
+ """
2031
+ return (
2032
+ self .files ()
2033
+ .filter (
2034
+ models .Q (filetype__icontains = "mach-o" ) |
2035
+ models .Q (mimetype__icontains = "application/x-mach-binary" )
2036
+ )
2037
+ )
2038
+
2039
+ def is_executable_binary (self ):
2040
+ return self .elfs ().union (self .win_exes (), self .mach_os ())
2011
2041
2012
2042
2013
2043
class ScanFieldsModelMixin (models .Model ):
You can’t perform that action at this time.
0 commit comments