mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-16 12:20:04 +00:00
b1d5db1cf6
# Conflicts: # src/core/CMakeLists.txt # src/core/arm/dynarmic/arm_dynarmic.cpp # src/core/arm/dyncom/arm_dyncom.cpp # src/core/hle/kernel/process.cpp # src/core/hle/kernel/thread.cpp # src/core/hle/kernel/thread.h # src/core/hle/kernel/vm_manager.cpp # src/core/loader/3dsx.cpp # src/core/loader/elf.cpp # src/core/loader/ncch.cpp # src/core/memory.cpp # src/core/memory.h # src/core/memory_setup.h
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
// Copyright 2017 Citra Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include "common/common_types.h"
|
|
#include "common/file_util.h"
|
|
#include "core/hle/kernel/kernel.h"
|
|
#include "core/loader/linker.h"
|
|
#include "core/loader/loader.h"
|
|
|
|
namespace Loader {
|
|
|
|
/// Loads an NSO file
|
|
class AppLoader_NSO final : public AppLoader, Linker {
|
|
public:
|
|
AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath)
|
|
: AppLoader(std::move(file)), filepath(std::move(filepath)) {
|
|
}
|
|
|
|
/**
|
|
* Returns the type of the file
|
|
* @param file FileUtil::IOFile open file
|
|
* @return FileType found, or FileType::Error if this loader doesn't know it
|
|
*/
|
|
static FileType IdentifyType(FileUtil::IOFile& file);
|
|
|
|
FileType GetFileType() override {
|
|
return IdentifyType(file);
|
|
}
|
|
|
|
ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
|
|
|
|
private:
|
|
VAddr LoadNso(const std::string& path, VAddr load_base, bool relocate = false);
|
|
|
|
std::string filepath;
|
|
};
|
|
|
|
} // namespace Loader
|