Files
Work/image/HOLD/RELOC.HPP
2024-08-07 09:16:27 -04:00

123 lines
2.7 KiB
C++

#ifndef _IMAGE_IMAGERELOCATION_HPP_
#define _IMAGE_IMAGERELOCATION_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
class ImageRelocation : private IMAGE_RELOCATION
{
public:
ImageRelocation(void);
ImageRelocation(const ImageRelocation &someImageRelocation);
virtual ~ImageRelocation();
ImageRelocation &operator=(const ImageRelocation &someImageRelocation);
bool operator==(const ImageRelocation &someImageRelocation)const;
DWORD virtualAddress(void)const;
void virtualAddress(DWORD virtualAddress);
DWORD relocationCount(void)const;
void relocationCount(DWORD relocationCount);
DWORD symbolTableIndex(void)const;
void symbolTableIndex(DWORD symbolTableIndex);
WORD relocationType(void)const;
void relocationType(WORD relocationType);
private:
void setZero(void);
};
inline
ImageRelocation::ImageRelocation(void)
{
setZero();
}
inline
ImageRelocation::ImageRelocation(const ImageRelocation &someImageRelocation)
{
*this=someImageRelocation;
}
inline
ImageRelocation::~ImageRelocation()
{
}
inline
ImageRelocation &ImageRelocation::operator=(const ImageRelocation &someImageRelocation)
{
virtualAddress(someImageRelocation.virtualAddress());
symbolTableIndex(someImageRelocation.symbolTableIndex());
relocationType(someImageRelocation.relocationType());
return *this;
}
inline
bool ImageRelocation::operator==(const ImageRelocation &someImageRelocation)const
{
return (virtualAddress()==someImageRelocation.virtualAddress()&&
symbolTableIndex()==someImageRelocation.symbolTableIndex()&&
relocationType()==someImageRelocation.relocationType());
}
inline
DWORD ImageRelocation::virtualAddress(void)const
{
return IMAGE_RELOCATION::VirtualAddress;
}
inline
void ImageRelocation::virtualAddress(DWORD virtualAddress)
{
IMAGE_RELOCATION::VirtualAddress=virtualAddress;
}
inline
DWORD ImageRelocation::relocationCount(void)const
{
return IMAGE_RELOCATION::RelocCount;
}
inline
void ImageRelocation::relocationCount(DWORD relocationCount)
{
IMAGE_RELOCATION::RelocCount=relocationCount;
}
inline
DWORD ImageRelocation::symbolTableIndex(void)const
{
return IMAGE_RELOCATION::SymbolTableIndex;
}
inline
void ImageRelocation::symbolTableIndex(DWORD symbolTableIndex)
{
IMAGE_RELOCATION::SymbolTableIndex=symbolTableIndex;
}
inline
WORD ImageRelocation::relocationType(void)const
{
return IMAGE_RELOCATION::Type;
}
inline
void ImageRelocation::relocationType(WORD relocationType)
{
IMAGE_RELOCATION::Type=relocationType;
}
inline
void ImageRelocation::setZero(void)
{
IMAGE_RELOCATION::VirtualAddress=0;
IMAGE_RELOCATION::SymbolTableIndex=0;
IMAGE_RELOCATION::Type=0;
}
typedef Block<ImageRelocation> ImageRelocations;
#endif