diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-28 04:40:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 04:40:46 +0200 |
commit | b096ec68cdbf6f1064a8b6b855489d38c3e59f6a (patch) | |
tree | 605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/elf.cpp | |
parent | Merge pull request #6246 from lioncash/shadow (diff) | |
parent | loader: Resolve instances of variable shadowing (diff) | |
download | yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.gz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.bz2 yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.lz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.xz yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.tar.zst yuzu-b096ec68cdbf6f1064a8b6b855489d38c3e59f6a.zip |
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r-- | src/core/loader/elf.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index f4a339390..627c18c7e 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -364,21 +364,24 @@ SectionID ElfReader::GetSectionByName(const char* name, int firstSection) const namespace Loader { -AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file) : AppLoader(std::move(file)) {} +AppLoader_ELF::AppLoader_ELF(FileSys::VirtualFile file_) : AppLoader(std::move(file_)) {} -FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& file) { +FileType AppLoader_ELF::IdentifyType(const FileSys::VirtualFile& elf_file) { static constexpr u16 ELF_MACHINE_ARM{0x28}; u32 magic = 0; - if (4 != file->ReadObject(&magic)) + if (4 != elf_file->ReadObject(&magic)) { return FileType::Error; + } u16 machine = 0; - if (2 != file->ReadObject(&machine, 18)) + if (2 != elf_file->ReadObject(&machine, 18)) { return FileType::Error; + } - if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) + if (Common::MakeMagic('\x7f', 'E', 'L', 'F') == magic && ELF_MACHINE_ARM == machine) { return FileType::ELF; + } return FileType::Error; } |