nso.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <string>
  6. #include "common/common_types.h"
  7. #include "core/hle/kernel/kernel.h"
  8. #include "core/loader/linker.h"
  9. #include "core/loader/loader.h"
  10. namespace Loader {
  11. /// Loads an NSO file
  12. class AppLoader_NSO final : public AppLoader, Linker {
  13. public:
  14. AppLoader_NSO(FileUtil::IOFile&& file, std::string filepath);
  15. /**
  16. * Returns the type of the file
  17. * @param file FileUtil::IOFile open file
  18. * @param filepath Path of the file that we are opening.
  19. * @return FileType found, or FileType::Error if this loader doesn't know it
  20. */
  21. static FileType IdentifyType(FileUtil::IOFile& file, const std::string& filepath);
  22. FileType GetFileType() override {
  23. return IdentifyType(file, filepath);
  24. }
  25. static VAddr LoadModule(const std::string& name, const std::vector<u8>& file_data,
  26. VAddr load_base);
  27. static VAddr LoadModule(const std::string& path, VAddr load_base);
  28. ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
  29. private:
  30. std::string filepath;
  31. };
  32. } // namespace Loader