diff options
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h')
-rw-r--r--[-rwxr-xr-x] | utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h b/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h index 81ef77ed6a..26c5d4009c 100755..100644 --- a/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h +++ b/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h | |||
@@ -1,58 +1,58 @@ | |||
1 | /* | 1 | /* |
2 | * IatDirectory.h - Part of the PeLib library. | 2 | * IatDirectory.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 IATDIRECTORY_H | 13 | #ifndef IATDIRECTORY_H |
14 | #define IATDIRECTORY_H | 14 | #define IATDIRECTORY_H |
15 | 15 | ||
16 | #include "PeLibInc.h" | 16 | #include "PeLibInc.h" |
17 | 17 | ||
18 | namespace PeLib | 18 | namespace PeLib |
19 | { | 19 | { |
20 | /// Class that handles the Import Address Table (IAT) | 20 | /// Class that handles the Import Address Table (IAT) |
21 | /** | 21 | /** |
22 | * This class can read and modify the Import Address Table of a PE file. | 22 | * This class can read and modify the Import Address Table of a PE file. |
23 | **/ | 23 | **/ |
24 | class IatDirectory | 24 | class IatDirectory |
25 | { | 25 | { |
26 | private: | 26 | private: |
27 | std::vector<dword> m_vIat; ///< Stores the individual IAT fields. | 27 | std::vector<dword> m_vIat; ///< Stores the individual IAT fields. |
28 | 28 | ||
29 | int read(InputBuffer& inputBuffer, unsigned int size); | 29 | int read(InputBuffer& inputBuffer, unsigned int size); |
30 | 30 | ||
31 | public: | 31 | public: |
32 | /// Reads the Import Address Table from a PE file. | 32 | /// Reads the Import Address Table from a PE file. |
33 | int read(const std::string& strFilename, unsigned int dwOffset, unsigned int dwSize); // EXPORT | 33 | int read(const std::string& strFilename, unsigned int dwOffset, unsigned int dwSize); // EXPORT |
34 | int read(unsigned char* buffer, unsigned int buffersize); // EXPORT | 34 | int read(unsigned char* buffer, unsigned int buffersize); // EXPORT |
35 | /// Returns the number of fields in the IAT. | 35 | /// Returns the number of fields in the IAT. |
36 | unsigned int calcNumberOfAddresses() const; // EXPORT | 36 | unsigned int calcNumberOfAddresses() const; // EXPORT |
37 | /// Adds another address to the IAT. | 37 | /// Adds another address to the IAT. |
38 | void addAddress(dword dwValue); // EXPORT | 38 | void addAddress(dword dwValue); // EXPORT |
39 | /// Removes an address from the IAT. | 39 | /// Removes an address from the IAT. |
40 | void removeAddress(unsigned int index); // EXPORT | 40 | void removeAddress(unsigned int index); // EXPORT |
41 | /// Empties the IAT. | 41 | /// Empties the IAT. |
42 | void clear(); // EXPORT | 42 | void clear(); // EXPORT |
43 | // Rebuilds the IAT. | 43 | // Rebuilds the IAT. |
44 | void rebuild(std::vector<byte>& vBuffer) const; // EXPORT | 44 | void rebuild(std::vector<byte>& vBuffer) const; // EXPORT |
45 | /// Returns the size of the current IAT. | 45 | /// Returns the size of the current IAT. |
46 | unsigned int size() const; // EXPORT | 46 | unsigned int size() const; // EXPORT |
47 | /// Writes the current IAT to a file. | 47 | /// Writes the current IAT to a file. |
48 | int write(const std::string& strFilename, unsigned int uiOffset) const; // EXPORT | 48 | int write(const std::string& strFilename, unsigned int uiOffset) const; // EXPORT |
49 | 49 | ||
50 | /// Retrieve the value of a field in the IAT. | 50 | /// Retrieve the value of a field in the IAT. |
51 | dword getAddress(unsigned int index) const; // EXPORT | 51 | dword getAddress(unsigned int index) const; // EXPORT |
52 | /// Change the value of a field in the IAT. | 52 | /// Change the value of a field in the IAT. |
53 | void setAddress(dword dwAddrnr, dword dwValue); // EXPORT | 53 | void setAddress(dword dwAddrnr, dword dwValue); // EXPORT |
54 | }; | 54 | }; |
55 | } | 55 | } |
56 | 56 | ||
57 | #endif | 57 | #endif |
58 | 58 | ||