mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-18 11:50:05 +00:00
Merge pull request #4922 from Steveice10/master
Filter non-executable files out of the game list.
This commit is contained in:
commit
4b05078def
@ -49,6 +49,11 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign
|
||||
if (!loader)
|
||||
return true;
|
||||
|
||||
bool executable = false;
|
||||
loader->IsExecutable(executable);
|
||||
if (!executable)
|
||||
return true;
|
||||
|
||||
u64 program_id = 0;
|
||||
loader->ReadProgramId(program_id);
|
||||
|
||||
|
@ -112,6 +112,16 @@ public:
|
||||
return std::make_pair(2, ResultStatus::Success);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether this application is executable.
|
||||
* @param out_executable Reference to store the executable flag into.
|
||||
* @return ResultStatus result of function
|
||||
*/
|
||||
virtual ResultStatus IsExecutable(bool& out_executable) {
|
||||
out_executable = true;
|
||||
return ResultStatus::Success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the code (typically .code section) of the application
|
||||
* @param buffer Reference to buffer to store data
|
||||
|
@ -198,6 +198,15 @@ ResultStatus AppLoader_NCCH::Load(std::shared_ptr<Kernel::Process>& process) {
|
||||
return ResultStatus::Success;
|
||||
}
|
||||
|
||||
ResultStatus AppLoader_NCCH::IsExecutable(bool& out_executable) {
|
||||
Loader::ResultStatus result = overlay_ncch->Load();
|
||||
if (result != Loader::ResultStatus::Success)
|
||||
return result;
|
||||
|
||||
out_executable = overlay_ncch->ncch_header.is_executable != 0;
|
||||
return ResultStatus::Success;
|
||||
}
|
||||
|
||||
ResultStatus AppLoader_NCCH::ReadCode(std::vector<u8>& buffer) {
|
||||
return overlay_ncch->LoadSectionExeFS(".code", buffer);
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
*/
|
||||
std::pair<std::optional<u32>, ResultStatus> LoadKernelSystemMode() override;
|
||||
|
||||
ResultStatus IsExecutable(bool& out_executable) override;
|
||||
|
||||
ResultStatus ReadCode(std::vector<u8>& buffer) override;
|
||||
|
||||
ResultStatus ReadIcon(std::vector<u8>& buffer) override;
|
||||
|
Loading…
Reference in New Issue
Block a user