00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#ifndef RELOCATIONSDIRECTORY_H
00014
#define RELOCATIONSDIRECTORY_H
00015
00016
namespace PeLib
00017 {
00019
00022 class RelocationsDirectory
00023 {
00024
private:
00025 std::vector<IMG_BASE_RELOC>
m_vRelocations;
00026
00027
public:
00029
unsigned int getNumberOfRelocations() const;
00031
unsigned int getNumberOfRelocationData(
unsigned int ulRelocation) const;
00032
00034
int read(const std::string& strFilename,
unsigned int uiOffset,
unsigned int uiSize);
00036
void rebuild(std::vector<byte>& vBuffer) const;
00038
unsigned int size() const;
00040
int write(const std::string& strFilename,
unsigned int dwOffset) const;
00041
00043 dword getVirtualAddress(
unsigned int ulRelocation) const;
00045 dword getSizeOfBlock(
unsigned int ulRelocation) const;
00047 word getRelocationData(
unsigned int ulRelocation,
unsigned int ulDataNumber) const;
00048
00050
void setRelocationData(
unsigned int ulRelocation,
unsigned int ulDataNumber, word wData);
00051
00053
void setVirtualAddress(
unsigned int ulRelocation, dword dwValue);
00055
void setSizeOfBlock(
unsigned int ulRelocation, dword dwValue);
00057
void addRelocationData(
unsigned int ulRelocation, word wValue);
00059
void removeRelocationData(
unsigned int ulRelocation, word wValue);
00060 };
00061 }
00062
00063 #endif