Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Disassembler always disassembles as little endian #1763

Closed
1 task
imaandrew opened this issue Jun 15, 2024 · 0 comments
Closed
1 task

[Bug] Disassembler always disassembles as little endian #1763

imaandrew opened this issue Jun 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@imaandrew
Copy link

Operating System

Windows

What's the issue you encountered?

The disassembler plugin will always disassemble bytes in little endian format even if the big endian option is selected.

In view_disassembler.cpp, the endianness choice is stored in the littleEndian variable:

// Draw endian radio buttons. This setting is available for all architectures
static int littleEndian = true;
ImGui::RadioButton("hex.ui.common.little_endian"_lang, &littleEndian, true);
ImGui::SameLine();
ImGui::RadioButton("hex.ui.common.big_endian"_lang, &littleEndian, false);

but the littleEndian variable is never referenced when setting m_mode

How can the issue be reproduced?

  • Create new file
  • Enter the following bytes: 3C 03 80 00
  • Disassemble using the MIPS64 mode

These bytes should be disassembled as lui $v1, 0x8000 in big endian format, but they get disassembled to raw bytes regardless of if big endian or little endian is selected

  • Enter the following bytes: 00 80 03 3C
  • Disassemble using the MIPS64 mode

These bytes will now disassemble to lui $v1, 0x8000 regardless of if big endian or little endian is selected

ImHex Version

1.34.0

ImHex Build Type

  • Nightly or built from sources

Installation type

MSI

Additional context?

No response

@imaandrew imaandrew added the bug Something isn't working label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant