1 /* 2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk. 3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 4 * Distributed under the terms of the MIT License. 5 */ 6 #ifndef DISASSEMBLER_X86_64_H 7 #define DISASSEMBLER_X86_64_H 8 9 #include <String.h> 10 11 #include "Types.h" 12 13 14 class CpuState; 15 class InstructionInfo; 16 17 18 class DisassemblerX8664 { 19 public: 20 DisassemblerX8664(); 21 virtual ~DisassemblerX8664(); 22 23 virtual status_t Init(target_addr_t address, const void* code, 24 size_t codeSize); 25 26 virtual status_t GetNextInstruction(BString& line, 27 target_addr_t& _address, 28 target_size_t& _size, 29 bool& _breakpointAllowed); 30 virtual status_t GetPreviousInstruction( 31 target_addr_t nextAddress, 32 target_addr_t& _address, 33 target_size_t& _size); 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_64_H 50