00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ANALY_X86_H
00022 #define ANALY_X86_H
00023
00024 #include "analy.h"
00025
00026 class AddressX86Flat32: public Address {
00027 public:
00028 dword addr;
00029 AddressX86Flat32();
00030 AddressX86Flat32(dword addr);
00031 virtual bool add(int offset);
00032 virtual int byteSize();
00033 virtual int compareTo(const Object *obj) const;
00034 virtual int compareDelinear(Address *to);
00035 virtual bool difference(int &result, Address *to);
00036 virtual Object *duplicate();
00037 virtual void getFromArray(const byte *array);
00038 virtual void getFromCPUAddress(CPU_ADDR *ca);
00039 virtual int load(ht_object_stream *s);
00040 virtual OBJECT_ID object_id() const;
00041 virtual int parseString(const char *s, int length, Analyser *a);
00042 virtual void putIntoArray(byte *array);
00043 virtual void putIntoCPUAddress(CPU_ADDR *ca);
00044 virtual void store(ht_object_stream *s);
00045 virtual int stringify(char *s, int max_length, int format);
00046 virtual int stringSize();
00047 };
00048
00049 class AddressX86_1616: public Address {
00050 public:
00051 word seg;
00052 word addr;
00053 public:
00054 AddressX86_1616();
00055 AddressX86_1616(word seg, word addr);
00056 virtual bool add(int offset);
00057 virtual int byteSize();
00058 virtual int compareTo(const Object *obj) const;
00059 virtual int compareDelinear(Address *to);
00060 virtual bool difference(int &result, Address *to);
00061 virtual Object *duplicate();
00062 virtual void getFromArray(const byte *array);
00063 virtual void getFromCPUAddress(CPU_ADDR *ca);
00064 virtual int load(ht_object_stream *s);
00065 virtual OBJECT_ID object_id() const;
00066 virtual int parseString(const char *s, int length, Analyser *a);
00067 virtual void putIntoArray(byte *array);
00068 virtual void putIntoCPUAddress(CPU_ADDR *ca);
00069 virtual void store(ht_object_stream *s);
00070 virtual int stringify(char *s, int max_length, int format);
00071 virtual int stringSize();
00072 };
00073
00074 class AddressX86_1632: public Address {
00075 public:
00076 word seg;
00077 dword addr;
00078 public:
00079 AddressX86_1632();
00080 AddressX86_1632(word seg, dword addr);
00081 virtual bool add(int offset);
00082 virtual int byteSize();
00083 virtual int compareTo(const Object *obj) const;
00084 virtual int compareDelinear(Address *obj);
00085 virtual bool difference(int &result, Address *to);
00086 virtual Object *duplicate();
00087 virtual void getFromArray(const byte *array);
00088 virtual void getFromCPUAddress(CPU_ADDR *ca);
00089 virtual int load(ht_object_stream *s);
00090 virtual OBJECT_ID object_id() const;
00091 virtual int parseString(const char *s, int length, Analyser *a);
00092 virtual void putIntoArray(byte *array);
00093 virtual void putIntoCPUAddress(CPU_ADDR *ca);
00094 virtual void store(ht_object_stream *s);
00095 virtual int stringify(char *s, int max_length, int format);
00096 virtual int stringSize();
00097 };
00098
00099 #define ANALYX86DISASSEMBLER_FLAGS_16BIT 1
00100 #define ANALYX86DISASSEMBLER_FLAGS_SEGMENTED 2
00101 #define ANALYX86DISASSEMBLER_FLAGS_FLAT64 4
00102 #define ANALYX86DISASSEMBLER_FLAGS_VXD_X86DIS 8
00103
00104 class AnalyX86Disassembler: public AnalyDisassembler {
00105 protected:
00106 void createUnasm();
00107 public:
00108 int flags;
00109
00110 void init(Analyser *A, int flags);
00111 int load(ht_object_stream *f);
00112 virtual void done();
00113 virtual OBJECT_ID object_id() const;
00114
00115 virtual Address *branchAddr(OPCODE *opcode, branch_enum_t branchtype, bool examine);
00116 Address *createAddress(word segment, dword offset);
00117 word getSegment(Address *addr);
00118 virtual void examineOpcode(OPCODE *opcode);
00119 virtual branch_enum_t isBranch(OPCODE *opcode);
00120 virtual void store(ht_object_stream *f);
00121 };
00122
00123 #endif