20 #include "Disassembler.h" 21 #include "pedigree/kernel/debugger/libudis86/udis86.h" 22 #include "pedigree/kernel/processor/types.h" 23 #include "pedigree/kernel/utilities/StaticString.h" 25 X86Disassembler::X86Disassembler() : m_Location(0), m_Mode(32), m_Obj()
28 ud_set_mode(&m_Obj, m_Mode);
29 ud_set_syntax(&m_Obj, UD_SYN_INTEL);
30 ud_set_pc(&m_Obj, m_Location);
31 ud_set_input_buffer(&m_Obj, reinterpret_cast<uint8_t *>(m_Location), 4096);
34 X86Disassembler::~X86Disassembler()
40 m_Location = nLocation;
41 ud_set_mode(&m_Obj, m_Mode);
42 ud_set_pc(&m_Obj, m_Location);
43 ud_set_input_buffer(&m_Obj, reinterpret_cast<uint8_t *>(m_Location), 4096);
44 ud_disassemble(&m_Obj);
54 if (nMode == 32 || nMode == 64)
56 ud_set_mode(&m_Obj, m_Mode);
61 text += ud_insn_asm(&m_Obj);
63 ud_disassemble(&m_Obj);
64 m_Location = ud_insn_off(&m_Obj);
void disassemble(LargeStaticString &text)
void setLocation(uintptr_t location)
void setMode(size_t mode)