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

ExportDirectory.h

00001 /* 00002 * ExportDirectory.h - Part of the PeLib library. 00003 * 00004 * Copyright (c) 2004 Sebastian Porst (webmaster@the-interweb.com) 00005 * All rights reserved. 00006 * 00007 * This software is licensed under the zlib/libpng License. 00008 * For more details see http://www.opensource.org/licenses/zlib-license.php 00009 * or the license information file (license.htm) in the root directory 00010 * of PeLib. 00011 */ 00012 00013 #ifndef EXPORTDIRECTORY_H 00014 #define EXPORTDIRECTORY_H 00015 #include "PeHeader.h" 00016 00017 namespace PeLib 00018 { 00020 00024 // template<int bits> 00025 class ExportDirectory 00026 { 00027 private: 00029 PELIB_IMAGE_EXP_DIRECTORY m_ied; 00030 00031 public: 00033 void addFunction(const std::string& strFuncname, dword dwFuncAddr); 00035 int getFunctionIndex(const std::string& strFunctionName) const; 00037 int read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize, const PeHeader& pehHeader); 00039 void rebuild(std::vector<byte>& vBuffer, dword dwRva) const; 00041 unsigned int size() const; 00043 int write(const std::string& strFilename, unsigned int uiOffset, unsigned int uiRva) const; 00044 00046 void setNameString(const std::string& strFilename); 00047 std::string getNameString() const; 00048 00050 std::string getFunctionName(dword dwIndex) const; 00052 word getFunctionOrdinal(dword dwIndex) const; 00054 dword getAddressOfName(dword dwIndex) const; 00056 dword getAddressOfFunction(dword dwIndex) const; 00057 00059 void setFunctionName(dword dwIndex, const std::string& strName); 00061 void setFunctionOrdinal(dword dwIndex, word wValue); 00063 void setAddressOfName(dword dwIndex, dword dwValue); 00065 void setAddressOfFunction(dword dwIndex, dword dwValue); 00066 00067 /* 00068 word getFunctionOrdinal(std::string strFuncname) const; 00069 dword getAddressOfName(std::string strFuncname) const; 00070 dword getAddressOfFunction(std::string strFuncname) const; 00071 00072 void setFunctionOrdinal(std::string strFuncname, word wValue); 00073 void setAddressOfName(std::string strFuncname, dword dwValue); 00074 void setAddressOfFunction(std::string strFuncname, dword dwValue); 00075 */ 00076 00078 dword getBase() const; 00080 dword getCharacteristics() const; 00082 dword getTimeDateStamp() const; 00084 word getMajorVersion() const; 00086 word getMinorVersion() const; 00088 dword getName() const; 00090 dword getNumberOfFunctions() const; 00092 dword getNumberOfNames() const; 00094 dword getAddressOfFunctions() const; 00096 dword getAddressOfNames() const; 00097 00099 dword getNumberOfNameOrdinals() const; 00101 dword getNumberOfAddressOfFunctionNames() const; 00103 dword getNumberOfAddressOfFunctions() const; 00105 dword getAddressOfNameOrdinals() const; 00106 00108 void setBase(dword dwValue); 00110 void setCharacteristics(dword dwValue); 00112 void setTimeDateStamp(dword dwValue); 00114 void setMajorVersion(word wValue); 00116 void setMinorVersion(word wValue); 00118 void setName(dword dwValue); 00120 void setNumberOfFunctions(dword dwValue); 00122 void setNumberOfNames(dword dwValue); 00124 void setAddressOfFunctions(dword dwValue); 00126 void setAddressOfNames(dword dwValue); 00127 }; 00128 } 00129 #endif

Generated on Mon Jan 17 20:50:08 2005 for PeLib by doxygen 1.3.7