diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-11 15:50:46 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-11 15:50:46 +0000 |
commit | 14c7f45cdae826f88dc539c8c38dd95caf305731 (patch) | |
tree | 832da054b7cfb2dc6fd63339af736625f31d21aa /utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h | |
parent | 7c84ede3781c27db73403bd6302f320c76a58c8c (diff) | |
download | rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.tar.gz rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.zip |
Add zook's ZenUtils to SVN
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18010 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h')
-rwxr-xr-x | utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h b/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h new file mode 100755 index 0000000000..81ef77ed6a --- /dev/null +++ b/utils/zenutils/libraries/pelib-0.9/pelib/IatDirectory.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * IatDirectory.h - Part of the PeLib library. | ||
3 | * | ||
4 | * Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com) | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * This software is licensed under the zlib/libpng License. | ||
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 | ||
10 | * of PeLib. | ||
11 | */ | ||
12 | |||
13 | #ifndef IATDIRECTORY_H | ||
14 | #define IATDIRECTORY_H | ||
15 | |||
16 | #include "PeLibInc.h" | ||
17 | |||
18 | namespace PeLib | ||
19 | { | ||
20 | /// Class that handles the Import Address Table (IAT) | ||
21 | /** | ||
22 | * This class can read and modify the Import Address Table of a PE file. | ||
23 | **/ | ||
24 | class IatDirectory | ||
25 | { | ||
26 | private: | ||
27 | std::vector<dword> m_vIat; ///< Stores the individual IAT fields. | ||
28 | |||
29 | int read(InputBuffer& inputBuffer, unsigned int size); | ||
30 | |||
31 | public: | ||
32 | /// Reads the Import Address Table from a PE file. | ||
33 | int read(const std::string& strFilename, unsigned int dwOffset, unsigned int dwSize); // EXPORT | ||
34 | int read(unsigned char* buffer, unsigned int buffersize); // EXPORT | ||
35 | /// Returns the number of fields in the IAT. | ||
36 | unsigned int calcNumberOfAddresses() const; // EXPORT | ||
37 | /// Adds another address to the IAT. | ||
38 | void addAddress(dword dwValue); // EXPORT | ||
39 | /// Removes an address from the IAT. | ||
40 | void removeAddress(unsigned int index); // EXPORT | ||
41 | /// Empties the IAT. | ||
42 | void clear(); // EXPORT | ||
43 | // Rebuilds the IAT. | ||
44 | void rebuild(std::vector<byte>& vBuffer) const; // EXPORT | ||
45 | /// Returns the size of the current IAT. | ||
46 | unsigned int size() const; // EXPORT | ||
47 | /// Writes the current IAT to a file. | ||
48 | int write(const std::string& strFilename, unsigned int uiOffset) const; // EXPORT | ||
49 | |||
50 | /// Retrieve the value of a field in the IAT. | ||
51 | dword getAddress(unsigned int index) const; // EXPORT | ||
52 | /// Change the value of a field in the IAT. | ||
53 | void setAddress(dword dwAddrnr, dword dwValue); // EXPORT | ||
54 | }; | ||
55 | } | ||
56 | |||
57 | #endif | ||
58 | |||