00001 #ifndef _FileHeader_h_ 00002 #define _FileHeader_h_ 00003 00004 #include <Base.h> 00005 #include <defines/FileHeader.d> 00006 00007 class FileHeader : public Base { 00008 protected: 00009 char* symbolTablePtr; 00010 00011 protected: 00012 FileHeader() : Base(XCoffClassTypes_file_header),symbolTablePtr(NULL) {} 00013 virtual ~FileHeader() {} 00014 bool verify(uint16_t targetSize); 00015 00016 public: 00017 00018 FILEHEADER_MACROS_BASIS("For the get_X field macros check the defines directory"); 00019 00020 void initFilePointers(BinaryInputFile* b); 00021 void print(); 00022 char* getSymbolTablePtr() { return symbolTablePtr; } 00023 const char* briefName() { return "FileHeader"; } 00024 }; 00025 00026 class FileHeader32 : public FileHeader { 00027 protected: 00028 FILHDR entry; 00029 00030 public: 00031 00032 FILEHEADER_MACROS_CLASS("For the get_X field macros check the defines directory"); 00033 00034 FileHeader32() { sizeInBytes = Size__32_bit_File_Header; } 00035 ~FileHeader32() {} 00036 uint32_t read(BinaryInputFile* b); 00037 uint32_t instrument(char* buffer,XCoffFileGen* xCoffGen,BaseGen* gen); 00038 }; 00039 00040 class FileHeader64 : public FileHeader { 00041 protected: 00042 FILHDR_64 entry; 00043 00044 public: 00045 00046 FILEHEADER_MACROS_CLASS("For the get_X field macros check the defines directory"); 00047 00048 FileHeader64() { sizeInBytes = Size__64_bit_File_Header; } 00049 ~FileHeader64() {} 00050 uint32_t read(BinaryInputFile* b); 00051 uint32_t instrument(char* buffer,XCoffFileGen* xCoffGen,BaseGen* gen); 00052 }; 00053 00054 #endif /* _FileHeader_h_ */