Skip to content

Commit 92d75df

Browse files
committed
Disable mpx mode in x86 as its been discontinued since 2019
1 parent 6e0806b commit 92d75df

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

arch/x86/arch_x86.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

19381939
BNEndianness 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

arch/x86/il.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ struct DISASSEMBLY_OPTIONS
2424

2525
bool lowerCase;
2626
std::string separator;
27+
bool mpx;
2728

28-
DISASSEMBLY_OPTIONS(DISASSEMBLY_FLAVOR_ENUM df = DF_BN_INTEL, bool lowerCase = true, std::string separator = ", ")
29-
: df(df), lowerCase(lowerCase), separator(separator) { };
29+
DISASSEMBLY_OPTIONS(DISASSEMBLY_FLAVOR_ENUM df = DF_BN_INTEL, bool lowerCase = true, std::string separator = ", ", bool mpx = false)
30+
: df(df), lowerCase(lowerCase), separator(separator), mpx(mpx) { };
3031
};
3132

3233
#define IL_FLAG_C 0

0 commit comments

Comments
 (0)