00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#ifndef EXPORTDIRECTORY_H
00014
#define EXPORTDIRECTORY_H
00015
#include "PeHeader.h"
00016
00017
namespace PeLib
00018 {
00020
00024
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
00069
00070
00071
00072
00073
00074
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