2022-04-28 19:24:11 +03:00
|
|
|
// SPDX-FileCopyrightText: 2013 Dolphin Emulator Project
|
|
|
|
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-03-25 18:47:12 +04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-06-19 02:58:09 +04:00
|
|
|
#include "core/loader/loader.h"
|
2014-06-17 07:05:10 +04:00
|
|
|
|
2020-09-16 15:19:25 +03:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2014-06-19 02:58:09 +04:00
|
|
|
namespace Loader {
|
2014-06-17 07:05:10 +04:00
|
|
|
|
2014-06-19 02:58:09 +04:00
|
|
|
/// Loads an ELF/AXF file
|
2014-07-04 21:20:40 +04:00
|
|
|
class AppLoader_ELF final : public AppLoader {
|
2014-06-17 07:05:10 +04:00
|
|
|
public:
|
2018-07-19 04:07:11 +03:00
|
|
|
explicit AppLoader_ELF(FileSys::VirtualFile file);
|
2014-06-17 07:05:10 +04:00
|
|
|
|
2015-01-07 02:10:13 +03:00
|
|
|
/**
|
2021-04-27 19:05:34 +03:00
|
|
|
* Identifies whether or not the given file is an ELF file.
|
|
|
|
*
|
|
|
|
* @param elf_file The file to identify.
|
|
|
|
*
|
|
|
|
* @return FileType::ELF, or FileType::Error if the file is not an ELF file.
|
2015-01-07 02:10:13 +03:00
|
|
|
*/
|
2021-04-27 19:05:34 +03:00
|
|
|
static FileType IdentifyType(const FileSys::VirtualFile& elf_file);
|
2015-01-07 02:10:13 +03:00
|
|
|
|
2018-12-06 01:42:41 +03:00
|
|
|
FileType GetFileType() const override {
|
2018-07-19 04:07:11 +03:00
|
|
|
return IdentifyType(file);
|
2016-05-18 01:30:44 +03:00
|
|
|
}
|
|
|
|
|
2021-04-24 08:04:28 +03:00
|
|
|
LoadResult Load(Kernel::KProcess& process, Core::System& system) override;
|
2014-03-25 18:47:12 +04:00
|
|
|
};
|
2014-06-17 07:18:10 +04:00
|
|
|
|
|
|
|
} // namespace Loader
|