MCPcopy Create free account
hub / github.com/avast/retdec / createFileFormat

Function createFileFormat

src/fileformat/format_factory.cpp:29–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 */
28
29std::unique_ptr<FileFormat> createFileFormat(
30 const std::string &filePath,
31 const std::string &dllListFile,
32 bool isRaw,
33 LoadFlags loadFlags)
34{
35 switch (detectFileFormat(filePath, isRaw))
36 {
37 case Format::PE:
38 return std::make_unique<PeFormat>(filePath, dllListFile, loadFlags);
39 case Format::ELF:
40 return std::make_unique<ElfFormat>(filePath, loadFlags);
41 case Format::COFF:
42 return std::make_unique<CoffFormat>(filePath, loadFlags);
43 case Format::MACHO:
44 return std::make_unique<MachOFormat>(filePath, loadFlags);
45 case Format::INTEL_HEX:
46 return std::make_unique<IntelHexFormat>(filePath, loadFlags);
47 case Format::RAW_DATA:
48 return std::make_unique<RawDataFormat>(filePath, loadFlags);
49 default:
50 return nullptr;
51 }
52}
53
54std::unique_ptr<FileFormat> createFileFormat(
55 const std::string &filePath,

Callers 5

detectPackersFunction · 0.85
mainFunction · 0.85
PatternExtractorMethod · 0.85
createImageFunction · 0.85
TEST_FFunction · 0.85

Calls 1

detectFileFormatFunction · 0.85

Tested by 1

TEST_FFunction · 0.68