@@ -417,7 +417,7 @@ bool X86CommonArchitecture::Decode(const uint8_t* data, size_t len, xed_decoded_
417
417
xed_decoded_inst_zero_keep_mode (xedd);
418
418
419
419
xed3_operand_set_cet (xedd, 1 );
420
- xed3_operand_set_mpxmode (xedd, 1 );
420
+ xed3_operand_set_mpxmode (xedd, m_disassembly_options. mpx );
421
421
422
422
// Decode the data and check for errors
423
423
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
1918
1918
const bool lowercase = settings->Get <bool >(" arch.x86.disassembly.lowercase" );
1919
1919
const string flavor = settings->Get <string>(" arch.x86.disassembly.syntax" );
1920
1920
const string separator = settings->Get <string>(" arch.x86.disassembly.separator" );
1921
+ const bool mpx = settings->Get <bool >(" arch.x86.disassembly.mpx" );
1921
1922
1922
1923
DISASSEMBLY_FLAVOR_ENUM flavorEnum;
1923
1924
@@ -1932,7 +1933,7 @@ X86CommonArchitecture::X86CommonArchitecture(const string& name, size_t bits): A
1932
1933
else
1933
1934
flavorEnum = DF_BN_INTEL;
1934
1935
1935
- m_disassembly_options = DISASSEMBLY_OPTIONS (flavorEnum, lowercase, separator);
1936
+ m_disassembly_options = DISASSEMBLY_OPTIONS (flavorEnum, lowercase, separator, mpx );
1936
1937
}
1937
1938
1938
1939
BNEndianness X86CommonArchitecture::GetEndianness () const
@@ -4794,6 +4795,15 @@ static void InitX86Settings()
4794
4795
"description" : "Specify the case for opcodes, operands, and registers.",
4795
4796
"ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
4796
4797
})~" );
4798
+
4799
+ settings->RegisterSetting (" arch.x86.disassembly.mpx" ,
4800
+ R"~( {
4801
+ "title" : "x86 Disassembly Support for MPX",
4802
+ "type" : "boolean",
4803
+ "default" : false,
4804
+ "description" : "Enable support for MPX extensions in the disassembler.",
4805
+ "ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
4806
+ })~" );
4797
4807
}
4798
4808
4799
4809
0 commit comments