diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 831366315..e17de3de3 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -25,6 +25,7 @@ #include "ui/viewgroup.h" #include "ui/ui.h" #include "ext/disarm.h" +#include "ext/udis86/udis86.h" #include "Common/LogManager.h" #include "Common/CPUDetect.h" @@ -491,7 +492,19 @@ void JitCompareScreen::UpdateDisasm() { rightDisasm_->Add(new TextView(targetDis[i])); } #else - rightDisasm_->Add(new TextView("No x86 disassembler available")); + ud_t ud_obj; + ud_init(&ud_obj); +#ifdef _M_X64 + ud_set_mode(&ud_obj, 64); +#endif + ud_set_pc(&ud_obj, (intptr_t)block->normalEntry); + ud_set_vendor(&ud_obj, UD_VENDOR_ANY); + ud_set_syntax(&ud_obj, UD_SYN_INTEL); + + ud_set_input_buffer(&ud_obj, block->normalEntry, block->codeSize); + while (ud_disassemble(&ud_obj) != 0) { + rightDisasm_->Add(new TextView(ud_insn_asm(&ud_obj))); + } #endif }