00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#ifndef BOUNDIMPORTDIRECTORY_H
00014
#define BOUNDIMPORTDIRECTORY_H
00015
00016
#include "PeLibAux.h"
00017
00018
namespace PeLib
00019 {
00021
00024 class BoundImportDirectory
00025 {
00026
private:
00027 std::vector<PELIB_IMAGE_BOUND_DIRECTORY>
m_vIbd;
00028
00029
public:
00031
int addBoundImport(
const std::string& strModuleName, dword dwTds, word dwOmn, word wWfr);
00033
int getModuleIndex(
const std::string& strModuleName)
const;
00035
int getNumberOfModules() const;
00037
int read(const std::string& strFileName, dword dwOffset, dword dwSize);
00039
void rebuild(std::vector<byte>& vBuffer,
bool fMakeValid = true) const;
00041
void clear();
00043
void removeBoundImport(const std::string& strModuleName);
00045
unsigned int size() const;
00047
int write(const std::string& strFilename, dword dwOffset,
bool fMakeValid = true) const;
00048
00050 dword getTimeDateStamp(dword dwBidnr) const;
00052 word getOffsetModuleName(dword dwBidnr) const;
00054 word getNumberOfModuleForwarderRefs(dword dwBidnr) const;
00056 std::string getModuleName(dword dwBidnr) const;
00057
00059
void setTimeDateStamp(dword dwBidnr, dword dwTds);
00061
void setOffsetModuleName(dword dwBidnr, word wOmn);
00063
void setNumberOfModuleForwarderRefs(dword dwBidnr, word wMfr);
00065
void setModuleName(dword dwBidnr, const std::string& strModuleName);
00066
00067 dword getTimeDateStamp(dword dwBidnr, dword forwardedModule) const;
00068 word getOffsetModuleName(dword dwBidnr, dword forwardedModule) const;
00069 word getNumberOfModuleForwarderRefs(dword dwBidnr, dword forwardedModule) const;
00070 std::string getModuleName(dword dwBidnr, dword forwardedModule) const;
00071
00072
void setTimeDateStamp(dword dwBidnr, dword forwardedModule, dword dwTds);
00073
void setOffsetModuleName(dword dwBidnr, dword forwardedModule, word wOmn);
00074
void setNumberOfModuleForwarderRefs(dword dwBidnr, dword forwardedModule, word wMfr);
00075
void setModuleName(dword dwBidnr, dword forwardedModule, const std::string& strModuleName);
00076
00077 word calcNumberOfModuleForwarderRefs(dword dwBidnr) const;
00078
void addForwardedModule(dword dwBidnr, const std::string& name, dword timeStamp = 0, word offsetModuleName = 0, word forwardedModules = 0);
00079
void removeForwardedModule(dword dwBidnr, word forwardedModule);
00080 };
00081 }
00082
00083
00084 #endif