diff options
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h')
-rw-r--r--[-rwxr-xr-x] | utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h | 266 |
1 files changed, 133 insertions, 133 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h b/utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h index 17a7e57020..19609b65a7 100755..100644 --- a/utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h +++ b/utils/zenutils/libraries/pelib-0.9/pelib/ExportDirectory.h | |||
@@ -1,133 +1,133 @@ | |||
1 | /* | 1 | /* |
2 | * ExportDirectory.h - Part of the PeLib library. | 2 | * ExportDirectory.h - Part of the PeLib library. |
3 | * | 3 | * |
4 | * Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com) | 4 | * Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com) |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * This software is licensed under the zlib/libpng License. | 7 | * This software is licensed under the zlib/libpng License. |
8 | * For more details see http://www.opensource.org/licenses/zlib-license.php | 8 | * For more details see http://www.opensource.org/licenses/zlib-license.php |
9 | * or the license information file (license.htm) in the root directory | 9 | * or the license information file (license.htm) in the root directory |
10 | * of PeLib. | 10 | * of PeLib. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef EXPORTDIRECTORY_H | 13 | #ifndef EXPORTDIRECTORY_H |
14 | #define EXPORTDIRECTORY_H | 14 | #define EXPORTDIRECTORY_H |
15 | #include "PeHeader.h" | 15 | #include "PeHeader.h" |
16 | 16 | ||
17 | namespace PeLib | 17 | namespace PeLib |
18 | { | 18 | { |
19 | /// Class that handles the export directory. | 19 | /// Class that handles the export directory. |
20 | /** | 20 | /** |
21 | * This class handles the export directory. | 21 | * This class handles the export directory. |
22 | * \todo getNameString | 22 | * \todo getNameString |
23 | **/ | 23 | **/ |
24 | // template<int bits> | 24 | // template<int bits> |
25 | class ExportDirectory | 25 | class ExportDirectory |
26 | { | 26 | { |
27 | private: | 27 | private: |
28 | /// Used to store all necessary information about a file's exported functions. | 28 | /// Used to store all necessary information about a file's exported functions. |
29 | PELIB_IMAGE_EXP_DIRECTORY m_ied; | 29 | PELIB_IMAGE_EXP_DIRECTORY m_ied; |
30 | 30 | ||
31 | public: | 31 | public: |
32 | /// Add another function to be exported. | 32 | /// Add another function to be exported. |
33 | void addFunction(const std::string& strFuncname, dword dwFuncAddr); // EXPORT | 33 | void addFunction(const std::string& strFuncname, dword dwFuncAddr); // EXPORT |
34 | unsigned int calcNumberOfFunctions() const; // EXPORT | 34 | unsigned int calcNumberOfFunctions() const; // EXPORT |
35 | void clear(); // EXPORT | 35 | void clear(); // EXPORT |
36 | /// Identifies a function through it's name. | 36 | /// Identifies a function through it's name. |
37 | int getFunctionIndex(const std::string& strFunctionName) const; // EXPORT | 37 | int getFunctionIndex(const std::string& strFunctionName) const; // EXPORT |
38 | /// Read a file's export directory. | 38 | /// Read a file's export directory. |
39 | int read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize, const PeHeader& pehHeader); // EXPORT | 39 | int read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize, const PeHeader& pehHeader); // EXPORT |
40 | /// Rebuild the current export directory. | 40 | /// Rebuild the current export directory. |
41 | void rebuild(std::vector<byte>& vBuffer, dword dwRva) const; // EXPORT | 41 | void rebuild(std::vector<byte>& vBuffer, dword dwRva) const; // EXPORT |
42 | void removeFunction(unsigned int index); // EXPORT | 42 | void removeFunction(unsigned int index); // EXPORT |
43 | /// Returns the size of the current export directory. | 43 | /// Returns the size of the current export directory. |
44 | unsigned int size() const; // EXPORT | 44 | unsigned int size() const; // EXPORT |
45 | /// Writes the current export directory to a file. | 45 | /// Writes the current export directory to a file. |
46 | int write(const std::string& strFilename, unsigned int uiOffset, unsigned int uiRva) const; // EXPORT | 46 | int write(const std::string& strFilename, unsigned int uiOffset, unsigned int uiRva) const; // EXPORT |
47 | 47 | ||
48 | /// Changes the name of the file (according to the export directory). | 48 | /// Changes the name of the file (according to the export directory). |
49 | void setNameString(const std::string& strFilename); // EXPORT | 49 | void setNameString(const std::string& strFilename); // EXPORT |
50 | std::string getNameString() const; // EXPORT | 50 | std::string getNameString() const; // EXPORT |
51 | 51 | ||
52 | /// Get the name of an exported function. | 52 | /// Get the name of an exported function. |
53 | std::string getFunctionName(unsigned int index) const; // EXPORT | 53 | std::string getFunctionName(unsigned int index) const; // EXPORT |
54 | /// Get the ordinal of an exported function. | 54 | /// Get the ordinal of an exported function. |
55 | word getFunctionOrdinal(unsigned int index) const; // EXPORT | 55 | word getFunctionOrdinal(unsigned int index) const; // EXPORT |
56 | /// Get the address of the name of an exported function. | 56 | /// Get the address of the name of an exported function. |
57 | dword getAddressOfName(unsigned int index) const; // EXPORT | 57 | dword getAddressOfName(unsigned int index) const; // EXPORT |
58 | /// Get the address of an exported function. | 58 | /// Get the address of an exported function. |
59 | dword getAddressOfFunction(unsigned int index) const; // EXPORT | 59 | dword getAddressOfFunction(unsigned int index) const; // EXPORT |
60 | 60 | ||
61 | /// Change the name of an exported function. | 61 | /// Change the name of an exported function. |
62 | void setFunctionName(unsigned int index, const std::string& strName); // EXPORT | 62 | void setFunctionName(unsigned int index, const std::string& strName); // EXPORT |
63 | /// Change the ordinal of an exported function. | 63 | /// Change the ordinal of an exported function. |
64 | void setFunctionOrdinal(unsigned int index, word wValue); // EXPORT | 64 | void setFunctionOrdinal(unsigned int index, word wValue); // EXPORT |
65 | /// Change the address of the name of an exported function. | 65 | /// Change the address of the name of an exported function. |
66 | void setAddressOfName(unsigned int index, dword dwValue); // EXPORT | 66 | void setAddressOfName(unsigned int index, dword dwValue); // EXPORT |
67 | /// Change the address of an exported function. | 67 | /// Change the address of an exported function. |
68 | void setAddressOfFunction(unsigned int index, dword dwValue); // EXPORT | 68 | void setAddressOfFunction(unsigned int index, dword dwValue); // EXPORT |
69 | 69 | ||
70 | /* | 70 | /* |
71 | word getFunctionOrdinal(std::string strFuncname) const; | 71 | word getFunctionOrdinal(std::string strFuncname) const; |
72 | dword getAddressOfName(std::string strFuncname) const; | 72 | dword getAddressOfName(std::string strFuncname) const; |
73 | dword getAddressOfFunction(std::string strFuncname) const; | 73 | dword getAddressOfFunction(std::string strFuncname) const; |
74 | 74 | ||
75 | void setFunctionOrdinal(std::string strFuncname, word wValue); | 75 | void setFunctionOrdinal(std::string strFuncname, word wValue); |
76 | void setAddressOfName(std::string strFuncname, dword dwValue); | 76 | void setAddressOfName(std::string strFuncname, dword dwValue); |
77 | void setAddressOfFunction(std::string strFuncname, dword dwValue); | 77 | void setAddressOfFunction(std::string strFuncname, dword dwValue); |
78 | */ | 78 | */ |
79 | 79 | ||
80 | /// Return the Base value of the export directory. | 80 | /// Return the Base value of the export directory. |
81 | dword getBase() const; // EXPORT | 81 | dword getBase() const; // EXPORT |
82 | /// Return the Characteristics value of the export directory. | 82 | /// Return the Characteristics value of the export directory. |
83 | dword getCharacteristics() const; // EXPORT | 83 | dword getCharacteristics() const; // EXPORT |
84 | /// Return the TimeDateStamp value of the export directory. | 84 | /// Return the TimeDateStamp value of the export directory. |
85 | dword getTimeDateStamp() const; // EXPORT | 85 | dword getTimeDateStamp() const; // EXPORT |
86 | /// Return the MajorVersion value of the export directory. | 86 | /// Return the MajorVersion value of the export directory. |
87 | word getMajorVersion() const; // EXPORT | 87 | word getMajorVersion() const; // EXPORT |
88 | /// Return the MinorVersion value of the export directory. | 88 | /// Return the MinorVersion value of the export directory. |
89 | word getMinorVersion() const; // EXPORT | 89 | word getMinorVersion() const; // EXPORT |
90 | /// Return the Name value of the export directory. | 90 | /// Return the Name value of the export directory. |
91 | dword getName() const; // EXPORT | 91 | dword getName() const; // EXPORT |
92 | /// Return the NumberOfFunctions value of the export directory. | 92 | /// Return the NumberOfFunctions value of the export directory. |
93 | dword getNumberOfFunctions() const; // EXPORT | 93 | dword getNumberOfFunctions() const; // EXPORT |
94 | /// Return the NumberOfNames value of the export directory. | 94 | /// Return the NumberOfNames value of the export directory. |
95 | dword getNumberOfNames() const; // EXPORT | 95 | dword getNumberOfNames() const; // EXPORT |
96 | /// Return the AddressOfFunctions value of the export directory. | 96 | /// Return the AddressOfFunctions value of the export directory. |
97 | dword getAddressOfFunctions() const; // EXPORT | 97 | dword getAddressOfFunctions() const; // EXPORT |
98 | /// Return the AddressOfNames value of the export directory. | 98 | /// Return the AddressOfNames value of the export directory. |
99 | dword getAddressOfNames() const; // EXPORT | 99 | dword getAddressOfNames() const; // EXPORT |
100 | /// Returns the AddressOfNameOrdinals value. | 100 | /// Returns the AddressOfNameOrdinals value. |
101 | dword getAddressOfNameOrdinals() const; // EXPORT | 101 | dword getAddressOfNameOrdinals() const; // EXPORT |
102 | 102 | ||
103 | /* /// Returns the number of NameOrdinals. | 103 | /* /// Returns the number of NameOrdinals. |
104 | dword getNumberOfNameOrdinals() const; // EXPORT | 104 | dword getNumberOfNameOrdinals() const; // EXPORT |
105 | /// Returns the number of AddressOfFunctionNames values. | 105 | /// Returns the number of AddressOfFunctionNames values. |
106 | dword getNumberOfAddressOfFunctionNames() const; // EXPORT | 106 | dword getNumberOfAddressOfFunctionNames() const; // EXPORT |
107 | /// Returns the number of AddressOfFunction values. | 107 | /// Returns the number of AddressOfFunction values. |
108 | dword getNumberOfAddressOfFunctions() const; // EXPORT | 108 | dword getNumberOfAddressOfFunctions() const; // EXPORT |
109 | */ | 109 | */ |
110 | /// Set the Base value of the export directory. | 110 | /// Set the Base value of the export directory. |
111 | void setBase(dword dwValue); // EXPORT | 111 | void setBase(dword dwValue); // EXPORT |
112 | /// Set the Characteristics value of the export directory. | 112 | /// Set the Characteristics value of the export directory. |
113 | void setCharacteristics(dword dwValue); // EXPORT | 113 | void setCharacteristics(dword dwValue); // EXPORT |
114 | /// Set the TimeDateStamp value of the export directory. | 114 | /// Set the TimeDateStamp value of the export directory. |
115 | void setTimeDateStamp(dword dwValue); // EXPORT | 115 | void setTimeDateStamp(dword dwValue); // EXPORT |
116 | /// Set the MajorVersion value of the export directory. | 116 | /// Set the MajorVersion value of the export directory. |
117 | void setMajorVersion(word wValue); // EXPORT | 117 | void setMajorVersion(word wValue); // EXPORT |
118 | /// Set the MinorVersion value of the export directory. | 118 | /// Set the MinorVersion value of the export directory. |
119 | void setMinorVersion(word wValue); // EXPORT | 119 | void setMinorVersion(word wValue); // EXPORT |
120 | /// Set the Name value of the export directory. | 120 | /// Set the Name value of the export directory. |
121 | void setName(dword dwValue); // EXPORT | 121 | void setName(dword dwValue); // EXPORT |
122 | /// Set the NumberOfFunctions value of the export directory. | 122 | /// Set the NumberOfFunctions value of the export directory. |
123 | void setNumberOfFunctions(dword dwValue); // EXPORT | 123 | void setNumberOfFunctions(dword dwValue); // EXPORT |
124 | /// Set the NumberOfNames value of the export directory. | 124 | /// Set the NumberOfNames value of the export directory. |
125 | void setNumberOfNames(dword dwValue); // EXPORT | 125 | void setNumberOfNames(dword dwValue); // EXPORT |
126 | /// Set the AddressOfFunctions value of the export directory. | 126 | /// Set the AddressOfFunctions value of the export directory. |
127 | void setAddressOfFunctions(dword dwValue); // EXPORT | 127 | void setAddressOfFunctions(dword dwValue); // EXPORT |
128 | /// Set the AddressOfNames value of the export directory. | 128 | /// Set the AddressOfNames value of the export directory. |
129 | void setAddressOfNames(dword dwValue); // EXPORT | 129 | void setAddressOfNames(dword dwValue); // EXPORT |
130 | void setAddressOfNameOrdinals(dword value); // EXPORT | 130 | void setAddressOfNameOrdinals(dword value); // EXPORT |
131 | }; | 131 | }; |
132 | } | 132 | } |
133 | #endif | 133 | #endif |