fix: Disassembler not supporting any Capstone 5 features anymore

Fixes #1010
This commit is contained in:
WerWolv 2023-04-04 23:08:10 +02:00
parent 6c047f01f9
commit 3658d8d96e
2 changed files with 7 additions and 10 deletions

View File

@ -21,14 +21,11 @@ namespace hex {
M680X, M680X,
EVM, EVM,
WASM, WASM,
#if defined(CS_MODE_RISCV32)
#if CS_API_MAJOR >= 5
RISCV, RISCV,
#endif
#if defined(CS_MODE_MOS65XX_6502)
MOS65XX, MOS65XX,
#endif BPF,
#if defined(CS_MODE_BPF_CLASSIC)
BPF,
#endif #endif
MAX, MAX,

View File

@ -187,7 +187,7 @@ namespace hex::plugin::builtin {
static bool qpx = false; static bool qpx = false;
ImGui::Checkbox("hex.builtin.view.disassembler.ppc.qpx"_lang, &qpx); ImGui::Checkbox("hex.builtin.view.disassembler.ppc.qpx"_lang, &qpx);
#if defined (CS_MODE_SPE) #if CS_API_MAJOR >= 5
static bool spe = false; static bool spe = false;
ImGui::Checkbox("hex.builtin.view.disassembler.ppc.spe"_lang, &spe); ImGui::Checkbox("hex.builtin.view.disassembler.ppc.spe"_lang, &spe);
static bool booke = false; static bool booke = false;
@ -207,7 +207,7 @@ namespace hex::plugin::builtin {
this->m_mode = cs_mode(v9Mode ? CS_MODE_V9 : cs_mode(0)); this->m_mode = cs_mode(v9Mode ? CS_MODE_V9 : cs_mode(0));
} }
break; break;
#if defined (CS_MODE_RISCV32) #if CS_API_MAJOR >= 5
case Architecture::RISCV: case Architecture::RISCV:
{ {
static int mode = CS_MODE_RISCV32; static int mode = CS_MODE_RISCV32;
@ -274,7 +274,7 @@ namespace hex::plugin::builtin {
this->m_mode = cs_mode(modes[selectedMode].second); this->m_mode = cs_mode(modes[selectedMode].second);
} }
break; break;
#if defined(CS_MODE_MOS65XX_6502) #if CS_API_MAJOR >= 5
case Architecture::MOS65XX: case Architecture::MOS65XX:
{ {
static int selectedMode = 0; static int selectedMode = 0;
@ -301,7 +301,7 @@ namespace hex::plugin::builtin {
} }
break; break;
#endif #endif
#if defined(CS_MODE_BPF_CLASSIC) #if CS_API_MAJOR >= 5
case Architecture::BPF: case Architecture::BPF:
{ {
static int mode = CS_MODE_BPF_CLASSIC; static int mode = CS_MODE_BPF_CLASSIC;