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

RelocationsDirectory.h

00001 /* 00002 * Relocations.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 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

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