00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ILDIS_H
00022 #define ILDIS_H
00023
00024 #include "asm.h"
00025 #include "global.h"
00026 #include "ilopc.h"
00027
00028 struct ILDisInsn {
00029 bool valid;
00030 int size;
00031 byte op;
00032 dword data;
00033 dword data2;
00034 ILOpcodeTabEntry *prefix;
00035 ILOpcodeTabEntry *opcode;
00036 };
00037
00038
00039
00040
00041
00042 class ILDisassembler: public Disassembler {
00043 protected:
00044 char insnstr[256];
00045 ILDisInsn insn;
00046 void *context;
00047 char* (*string_func)(dword string_ofs, void *context);
00048 char* (*token_func)(dword token, void *context);
00049 public:
00050 ILDisassembler(char* (*string_func)(dword string_ofs, void *context), char* (*token_func)(dword token, void *context), void *context);
00051 virtual ~ILDisassembler();
00052
00053 virtual dis_insn *decode(byte *code, int maxlen, CPU_ADDR addr);
00054 virtual dis_insn *duplicateInsn(dis_insn *disasm_insn);
00055 virtual void getOpcodeMetrics(int &min_length, int &max_length, int &min_look_ahead, int &avg_look_ahead, int &addr_align);
00056 virtual byte getSize(dis_insn *disasm_insn);
00057 virtual char *getName();
00058 virtual char *str(dis_insn *disasm_insn, int style);
00059 virtual char *strf(dis_insn *disasm_insn, int style, char *format);
00060 virtual OBJECT_ID object_id() const;
00061 virtual bool validInsn(dis_insn *disasm_insn);
00062 };
00063
00064 #endif