Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 11 lines (8 sloc) 0.298 kB
7d5975e @hiratara initial commit
authored
1 import qualified Data.ByteString.Lazy as L
2
3 hasElfMagic :: L.ByteString -> Bool
4 hasElfMagic content = L.take 4 content == elfMagic
5 where elfMagic = L.pack [0x7f, 0x45, 0x4c, 0x46]
6
7 isElfFile :: FilePath -> IO Bool
8 isElfFile path = do
9 content <- L.readFile path
10 return (hasElfMagic content)
Something went wrong with that request. Please try again.