1 /* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef DISASSEMBLER_X86_H 6 #define DISASSEMBLER_X86_H 7 8 #include <String.h> 9 10 #include "Types.h" 11 12 13 class CpuState; 14 class InstructionInfo; 15 16 17 class DisassemblerX86 { 18 public: 19 DisassemblerX86(); 20 virtual ~DisassemblerX86(); 21 22 virtual status_t Init(target_addr_t address, const void* code, 23 size_t codeSize); 24 25 virtual status_t GetNextInstruction(BString& line, 26 target_addr_t& _address, 27 target_size_t& _size, 28 bool& _breakpointAllowed); 29 virtual status_t GetPreviousInstruction( 30 target_addr_t nextAddress, 31 target_addr_t& _address, 32 target_size_t& _size); 33 34 virtual status_t GetNextInstructionInfo( 35 InstructionInfo& _info, 36 CpuState* state); 37 38 private: 39 struct ZydisData; 40 41 private: 42 target_addr_t fAddress; 43 const uint8* fCode; 44 size_t fCodeSize; 45 ZydisData* fZydisData; 46 }; 47 48 49 #endif // DISASSEMBLER_X86_H 50