13 #ifndef RETDEC_PELIB_EXPORTDIRECTORY_H
14 #define RETDEC_PELIB_EXPORTDIRECTORY_H
42 void addFunction(
const std::string& strFuncname, std::uint32_t dwFuncAddr);
48 void rebuild(std::vector<std::uint8_t>& vBuffer, std::uint32_t dwRva)
const;
51 unsigned int size()
const;
53 int write(
const std::string& strFilename,
unsigned int uiOffset,
unsigned int uiRva)
const;
118 void setBase(std::uint32_t dwValue);
128 void setName(std::uint32_t dwValue);
Class that handles the export directory.
Definition: ExportDirectory.h:26
std::uint32_t getAddressOfFunction(std::size_t index) const
Get the address of an exported function.
Definition: ExportDirectory.cpp:348
std::vector< std::pair< unsigned int, unsigned int > > m_occupiedAddresses
Stores RVAs which are occupied by this export directory.
Definition: ExportDirectory.h:31
void rebuild(std::vector< std::uint8_t > &vBuffer, std::uint32_t dwRva) const
Rebuild the current export directory.
Definition: ExportDirectory.cpp:179
std::uint32_t getAddressOfFunctions() const
Return the AddressOfFunctions value of the export directory.
Definition: ExportDirectory.cpp:456
const std::vector< std::pair< unsigned int, unsigned int > > & getOccupiedAddresses() const
Definition: ExportDirectory.cpp:577
std::string getNameString() const
Definition: ExportDirectory.cpp:312
void setNameString(const std::string &strFilename)
Changes the name of the file (according to the export directory).
Definition: ExportDirectory.cpp:307
int write(const std::string &strFilename, unsigned int uiOffset, unsigned int uiRva) const
Writes the current export directory to a file.
Definition: ExportDirectory.cpp:271
void setAddressOfNames(std::uint32_t dwValue)
Set the AddressOfNames value of the export directory.
Definition: ExportDirectory.cpp:567
void setBase(std::uint32_t dwValue)
Set the Base value of the export directory.
Definition: ExportDirectory.cpp:495
void setMinorVersion(std::uint16_t wValue)
Set the MinorVersion value of the export directory.
Definition: ExportDirectory.cpp:527
void removeFunction(unsigned int index)
Definition: ExportDirectory.cpp:137
void setFunctionName(std::size_t index, const std::string &strName)
Change the name of an exported function.
Definition: ExportDirectory.cpp:357
void setCharacteristics(std::uint32_t dwValue)
Set the Characteristics value of the export directory.
Definition: ExportDirectory.cpp:503
std::uint32_t getName() const
Return the Name value of the export directory.
Definition: ExportDirectory.cpp:432
std::uint32_t getAddressOfName(std::size_t index) const
Get the address of the name of an exported function.
Definition: ExportDirectory.cpp:339
void setNumberOfFunctions(std::uint32_t dwValue)
Set the NumberOfFunctions value of the export directory.
Definition: ExportDirectory.cpp:543
std::uint32_t getAddressOfNameOrdinals() const
Returns the AddressOfNameOrdinals value.
Definition: ExportDirectory.cpp:487
std::uint16_t getMajorVersion() const
Return the MajorVersion value of the export directory.
Definition: ExportDirectory.cpp:416
void addOccupiedAddress(const std::string &str, std::uint32_t rva)
Definition: ExportDirectory.cpp:22
void setFunctionOrdinal(std::size_t index, std::uint16_t wValue)
Change the ordinal of an exported function.
Definition: ExportDirectory.cpp:366
void setMajorVersion(std::uint16_t wValue)
Set the MajorVersion value of the export directory.
Definition: ExportDirectory.cpp:519
void addFunction(const std::string &strFuncname, std::uint32_t dwFuncAddr)
Add another function to be exported.
Definition: ExportDirectory.cpp:129
std::uint32_t getAddressOfNames() const
Return the AddressOfNames value of the export directory.
Definition: ExportDirectory.cpp:464
std::uint16_t getFunctionOrdinal(std::size_t index) const
Get the ordinal of an exported function.
Definition: ExportDirectory.cpp:330
std::string getFunctionName(std::size_t index) const
Get the name of an exported function.
Definition: ExportDirectory.cpp:321
void setAddressOfFunctions(std::uint32_t dwValue)
Set the AddressOfFunctions value of the export directory.
Definition: ExportDirectory.cpp:559
void setName(std::uint32_t dwValue)
Set the Name value of the export directory.
Definition: ExportDirectory.cpp:535
std::uint32_t getBase() const
Return the Base value of the export directory.
Definition: ExportDirectory.cpp:392
void setNumberOfNames(std::uint32_t dwValue)
Set the NumberOfNames value of the export directory.
Definition: ExportDirectory.cpp:551
void setTimeDateStamp(std::uint32_t dwValue)
Set the TimeDateStamp value of the export directory.
Definition: ExportDirectory.cpp:511
unsigned int size() const
Returns the size of the current export directory.
Definition: ExportDirectory.cpp:260
virtual ~ExportDirectory()=default
int getFunctionIndex(const std::string &strFunctionName) const
Identifies a function through it's name.
Definition: ExportDirectory.cpp:157
int read(ImageLoader &imageLoader)
Load the export directory from the image loader.
Definition: ExportDirectory.cpp:33
std::uint32_t getTimeDateStamp() const
Return the TimeDateStamp value of the export directory.
Definition: ExportDirectory.cpp:408
std::uint16_t getMinorVersion() const
Return the MinorVersion value of the export directory.
Definition: ExportDirectory.cpp:424
void setAddressOfName(std::size_t index, std::uint32_t dwValue)
Change the address of the name of an exported function.
Definition: ExportDirectory.cpp:375
std::uint32_t getNumberOfNames() const
Return the NumberOfNames value of the export directory.
Definition: ExportDirectory.cpp:448
std::uint32_t getCharacteristics() const
Return the Characteristics value of the export directory.
Definition: ExportDirectory.cpp:400
void clear()
Definition: ExportDirectory.cpp:142
void setAddressOfNameOrdinals(std::uint32_t value)
Definition: ExportDirectory.cpp:572
std::uint32_t getNumberOfFunctions() const
Return the NumberOfFunctions value of the export directory.
Definition: ExportDirectory.cpp:440
void setAddressOfFunction(std::size_t index, std::uint32_t dwValue)
Change the address of an exported function.
Definition: ExportDirectory.cpp:384
unsigned int calcNumberOfFunctions() const
Definition: ExportDirectory.cpp:147
PELIB_IMAGE_EXP_DIRECTORY m_ied
Used to store all necessary information about a file's exported functions.
Definition: ExportDirectory.h:29
Definition: ImageLoader.h:138
Definition: BoundImportDirectory.h:21
Definition: PeLibAux.h:1041