summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2025-10-03 15:13:21 -0400
committerPeter LaFosse <peter@vector35.com>2025-10-03 15:41:00 -0400
commit92d75df37c76813ac4a71e35096dcb31ac1b18af (patch)
tree2c2a9ab259ae90a1e2a5a8eb4efb789dc962638d /arch
parent6e0806b4d18e456ebfb1d1d45b2ccc55713309c8 (diff)
Disable mpx mode in x86 as its been discontinued since 2019
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/arch_x86.cpp14
-rw-r--r--arch/x86/il.h5
2 files changed, 15 insertions, 4 deletions
diff --git a/arch/x86/arch_x86.cpp b/arch/x86/arch_x86.cpp
index 4fb81c11..b4488623 100644
--- a/arch/x86/arch_x86.cpp
+++ b/arch/x86/arch_x86.cpp
@@ -417,7 +417,7 @@ bool X86CommonArchitecture::Decode(const uint8_t* data, size_t len, xed_decoded_
xed_decoded_inst_zero_keep_mode(xedd);
xed3_operand_set_cet(xedd, 1);
- xed3_operand_set_mpxmode(xedd, 1);
+ xed3_operand_set_mpxmode(xedd, m_disassembly_options.mpx);
// Decode the data and check for errors
xed_error_enum_t xed_error = xed_decode(xedd, data, (unsigned)len);
@@ -1918,6 +1918,7 @@ X86CommonArchitecture::X86CommonArchitecture(const string& name, size_t bits): A
const bool lowercase = settings->Get<bool>("arch.x86.disassembly.lowercase");
const string flavor = settings->Get<string>("arch.x86.disassembly.syntax");
const string separator = settings->Get<string>("arch.x86.disassembly.separator");
+ const bool mpx = settings->Get<bool>("arch.x86.disassembly.mpx");
DISASSEMBLY_FLAVOR_ENUM flavorEnum;
@@ -1932,7 +1933,7 @@ X86CommonArchitecture::X86CommonArchitecture(const string& name, size_t bits): A
else
flavorEnum = DF_BN_INTEL;
- m_disassembly_options = DISASSEMBLY_OPTIONS(flavorEnum, lowercase, separator);
+ m_disassembly_options = DISASSEMBLY_OPTIONS(flavorEnum, lowercase, separator, mpx);
}
BNEndianness X86CommonArchitecture::GetEndianness() const
@@ -4794,6 +4795,15 @@ static void InitX86Settings()
"description" : "Specify the case for opcodes, operands, and registers.",
"ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
})~");
+
+ settings->RegisterSetting("arch.x86.disassembly.mpx",
+ R"~({
+ "title" : "x86 Disassembly Support for MPX",
+ "type" : "boolean",
+ "default" : false,
+ "description" : "Enable support for MPX extensions in the disassembler.",
+ "ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
+ })~");
}
diff --git a/arch/x86/il.h b/arch/x86/il.h
index 41f41dee..1bef0606 100644
--- a/arch/x86/il.h
+++ b/arch/x86/il.h
@@ -24,9 +24,10 @@ struct DISASSEMBLY_OPTIONS
bool lowerCase;
std::string separator;
+ bool mpx;
- DISASSEMBLY_OPTIONS(DISASSEMBLY_FLAVOR_ENUM df = DF_BN_INTEL, bool lowerCase = true, std::string separator = ", ")
- : df(df), lowerCase(lowerCase), separator(separator) { };
+ DISASSEMBLY_OPTIONS(DISASSEMBLY_FLAVOR_ENUM df = DF_BN_INTEL, bool lowerCase = true, std::string separator = ", ", bool mpx = false)
+ : df(df), lowerCase(lowerCase), separator(separator), mpx(mpx) { };
};
#define IL_FLAG_C 0