nro.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 NRO file
  12. class AppLoader_NRO final : public AppLoader, Linker {
  13. public:
  14. AppLoader_NRO(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. ResultStatus Load(Kernel::SharedPtr<Kernel::Process>& process) override;
  26. private:
  27. bool LoadNro(const std::string& path, VAddr load_base);
  28. std::string filepath;
  29. };
  30. } // namespace Loader