summaryrefslogtreecommitdiffstats
path: root/src/core/loader/elf.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2021-04-27 18:05:34 +0200
committerLioncash <mathew1800@gmail.com>2021-04-27 18:48:15 +0200
commit724c19a307f31ce1122fb8047c86d5a126d0860f (patch)
tree605b89f42d7897aac46f06add54c34201d9354bd /src/core/loader/elf.cpp
parentMerge pull request #6246 from lioncash/shadow (diff)
downloadyuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.gz
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.bz2
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.lz
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.xz
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.tar.zst
yuzu-724c19a307f31ce1122fb8047c86d5a126d0860f.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/elf.cpp13
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;
}