2018-01-13 13:22:39 -08:00
|
|
|
// Copyright 2018 yuzu emulator team
|
2017-09-24 08:08:31 -07:00
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "common/common_types.h"
|
2018-08-01 19:40:00 -07:00
|
|
|
#include "core/hle/kernel/object.h"
|
2017-10-05 20:30:08 -07:00
|
|
|
#include "core/loader/linker.h"
|
2017-09-24 08:08:31 -07:00
|
|
|
#include "core/loader/loader.h"
|
|
|
|
|
|
|
|
namespace Loader {
|
|
|
|
|
|
|
|
/// Loads an NSO file
|
2017-10-05 20:30:08 -07:00
|
|
|
class AppLoader_NSO final : public AppLoader, Linker {
|
2017-09-24 08:08:31 -07:00
|
|
|
public:
|
2018-07-18 18:07:11 -07:00
|
|
|
explicit AppLoader_NSO(FileSys::VirtualFile file);
|
2017-09-24 08:08:31 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the type of the file
|
2018-07-18 18:07:11 -07:00
|
|
|
* @param file std::shared_ptr<VfsFile> open file
|
2017-09-24 08:08:31 -07:00
|
|
|
* @return FileType found, or FileType::Error if this loader doesn't know it
|
|
|
|
*/
|
2018-07-18 18:07:11 -07:00
|
|
|
static FileType IdentifyType(const FileSys::VirtualFile& file);
|
2017-09-24 08:08:31 -07:00
|
|
|
|
|
|
|
FileType GetFileType() override {
|
2018-07-18 18:07:11 -07:00
|
|
|
return IdentifyType(file);
|
2017-09-24 08:08:31 -07:00
|
|
|
}
|
|
|
|
|
2018-07-18 18:07:11 -07:00
|
|
|
static VAddr LoadModule(FileSys::VirtualFile file, VAddr load_base);
|
2018-01-20 11:20:04 -08:00
|
|
|
|
2017-10-09 20:56:20 -07:00
|
|
|
ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
|
2017-09-24 08:08:31 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Loader
|