diff options
| author | Xusheng <xusheng@vector35.com> | 2024-06-19 13:08:26 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2024-06-19 13:08:26 +0800 |
| commit | aff1ae1b17236936e731e423e660a18937567bd7 (patch) | |
| tree | f92326a522534a0ad49c107e16a125d19b6b4cb7 /view/elf | |
| parent | 7b705d4047cb358fb7e6cc5234b969379c6a3f38 (diff) | |
Fix up the files.elf.detectARMBE8Binary setting
Diffstat (limited to 'view/elf')
| -rw-r--r-- | view/elf/elfview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index cf9f4efa..d94498f1 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -2749,7 +2749,8 @@ uint64_t ElfViewType::ParseHeaders(BinaryView* data, ElfIdent& ident, ElfCommonH // retrieve architecture // FIXME: Architecture registration methods should perhaps be virtual and take the raw data, or some additional opaque information. - if (Settings::Instance()->Get<bool>("files.elf.detectARMBE8Binary")) + bool checkForARMBE8 = Settings::Instance()->Get<bool>("files.elf.detectARMBE8Binary"); + if (checkForARMBE8) endianness = ((commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8)) ? BigEndian : endianness; /* for architectures where .e_machine field doesn't disambiguate between 32/64 (like MIPS), @@ -2774,7 +2775,7 @@ uint64_t ElfViewType::ParseHeaders(BinaryView* data, ElfIdent& ident, ElfCommonH else { BNEndianness codeEndianness = endianness; - if ((commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8)) + if (checkForARMBE8 && (commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8)) codeEndianness = LittleEndian; if (arch) |
