@@ -417,7 +417,7 @@ bool X86CommonArchitecture::Decode(const uint8_t* data, size_t len, xed_decoded_
417417 xed_decoded_inst_zero_keep_mode (xedd);
418418
419419 xed3_operand_set_cet (xedd, 1 );
420- xed3_operand_set_mpxmode (xedd, 1 );
420+ xed3_operand_set_mpxmode (xedd, m_disassembly_options. mpx );
421421
422422 // Decode the data and check for errors
423423 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
19181918 const bool lowercase = settings->Get <bool >(" arch.x86.disassembly.lowercase" );
19191919 const string flavor = settings->Get <string>(" arch.x86.disassembly.syntax" );
19201920 const string separator = settings->Get <string>(" arch.x86.disassembly.separator" );
1921+ const bool mpx = settings->Get <bool >(" arch.x86.disassembly.mpx" );
19211922
19221923 DISASSEMBLY_FLAVOR_ENUM flavorEnum;
19231924
@@ -1932,7 +1933,7 @@ X86CommonArchitecture::X86CommonArchitecture(const string& name, size_t bits): A
19321933 else
19331934 flavorEnum = DF_BN_INTEL;
19341935
1935- m_disassembly_options = DISASSEMBLY_OPTIONS (flavorEnum, lowercase, separator);
1936+ m_disassembly_options = DISASSEMBLY_OPTIONS (flavorEnum, lowercase, separator, mpx );
19361937}
19371938
19381939BNEndianness X86CommonArchitecture::GetEndianness () const
@@ -4794,6 +4795,15 @@ static void InitX86Settings()
47944795 "description" : "Specify the case for opcodes, operands, and registers.",
47954796 "ignore" : ["SettingsProjectScope", "SettingsResourceScope"]
47964797 })~" );
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+ })~" );
47974807}
47984808
47994809
0 commit comments