Skip to content

Commit aff1ae1

Browse files
committed
Fix up the files.elf.detectARMBE8Binary setting
1 parent 7b705d4 commit aff1ae1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

view/elf/elfview.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,8 @@ uint64_t ElfViewType::ParseHeaders(BinaryView* data, ElfIdent& ident, ElfCommonH
27492749
// retrieve architecture
27502750
// FIXME: Architecture registration methods should perhaps be virtual and take the raw data, or some additional opaque information.
27512751

2752-
if (Settings::Instance()->Get<bool>("files.elf.detectARMBE8Binary"))
2752+
bool checkForARMBE8 = Settings::Instance()->Get<bool>("files.elf.detectARMBE8Binary");
2753+
if (checkForARMBE8)
27532754
endianness = ((commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8)) ? BigEndian : endianness;
27542755

27552756
/* 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
27742775
else
27752776
{
27762777
BNEndianness codeEndianness = endianness;
2777-
if ((commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8))
2778+
if (checkForARMBE8 && (commonHeader.arch == EM_ARM) && (header.flags & EF_ARM_BE8))
27782779
codeEndianness = LittleEndian;
27792780

27802781
if (arch)

0 commit comments

Comments
 (0)