forked from OSchip/llvm-project
parent
55680d0add
commit
deaba3862f
|
@ -185,8 +185,8 @@ file_magic llvm::identify_magic(StringRef Magic) {
|
|||
if (startswith(Magic, "MZ") && Magic.size() >= 0x3c + 4) {
|
||||
uint32_t off = read32le(Magic.data() + 0x3c);
|
||||
// PE/COFF file, either EXE or DLL.
|
||||
if (off + sizeof(COFF::PEMagic) <= Magic.size() &&
|
||||
memcmp(Magic.data() + off, COFF::PEMagic, sizeof(COFF::PEMagic)) == 0)
|
||||
if (Magic.substr(off).startswith(
|
||||
StringRef(COFF::PEMagic, sizeof(COFF::PEMagic))))
|
||||
return file_magic::pecoff_executable;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue