Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

analy_x86.h

Go to the documentation of this file.
00001 /*
00002  *      HT Editor
00003  *      analy_x86.h
00004  *
00005  *      Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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

Generated on Fri May 7 21:15:29 2004 by doxygen 1.3.5