elf.h 880 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
  2. // SPDX-FileCopyrightText: 2014 Citra Emulator Project
  3. // SPDX-License-Identifier: GPL-2.0-or-later
  4. #pragma once
  5. #include "core/loader/loader.h"
  6. namespace Core {
  7. class System;
  8. }
  9. namespace Loader {
  10. /// Loads an ELF/AXF file
  11. class AppLoader_ELF final : public AppLoader {
  12. public:
  13. explicit AppLoader_ELF(FileSys::VirtualFile file);
  14. /**
  15. * Identifies whether or not the given file is an ELF file.
  16. *
  17. * @param elf_file The file to identify.
  18. *
  19. * @return FileType::ELF, or FileType::Error if the file is not an ELF file.
  20. */
  21. static FileType IdentifyType(const FileSys::VirtualFile& elf_file);
  22. FileType GetFileType() const override {
  23. return IdentifyType(file);
  24. }
  25. LoadResult Load(Kernel::KProcess& process, Core::System& system) override;
  26. };
  27. } // namespace Loader