Lines Matching refs:magic
59 static int OpenAndReadMagic(const char* filename, uint32_t* magic, std::string* error_msg) { in OpenAndReadMagic() argument
60 CHECK(magic != nullptr); in OpenAndReadMagic()
66 int n = TEMP_FAILURE_RETRY(read(fd.get(), magic, sizeof(*magic))); in OpenAndReadMagic()
67 if (n != sizeof(*magic)) { in OpenAndReadMagic()
81 uint32_t magic; in GetChecksum() local
95 ScopedFd fd(OpenAndReadMagic(file_part, &magic, error_msg)); in GetChecksum()
100 if (IsZipMagic(magic)) { in GetChecksum()
117 if (IsDexMagic(magic)) { in GetChecksum()
133 uint32_t magic; in Open() local
134 ScopedFd fd(OpenAndReadMagic(filename, &magic, error_msg)); in Open()
139 if (IsZipMagic(magic)) { in Open()
142 if (IsDexMagic(magic)) { in Open()
167 uint32_t magic; in MaybeDex() local
169 ScopedFd fd(OpenAndReadMagic(filename, &magic, &error_msg)); in MaybeDex()
173 if (IsZipMagic(magic)) { in MaybeDex()
175 } else if (IsDexMagic(magic)) { in MaybeDex()
459 bool DexFile::IsMagicValid(const uint8_t* magic) { in IsMagicValid() argument
460 return (memcmp(magic, kDexMagic, sizeof(kDexMagic)) == 0); in IsMagicValid()
463 bool DexFile::IsVersionValid(const uint8_t* magic) { in IsVersionValid() argument
464 const uint8_t* version = &magic[sizeof(kDexMagic)]; in IsVersionValid()