diff options
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.h')
-rwxr-xr-x | utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.h b/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.h new file mode 100755 index 0000000000..0ffda38815 --- /dev/null +++ b/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * DebugDirectory.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 DEBUGDIRECTORY_H | ||
14 | #define DEBUGDIRECTORY_H | ||
15 | |||
16 | namespace PeLib | ||
17 | { | ||
18 | /// Class that handles the Debug directory. | ||
19 | class DebugDirectory | ||
20 | { | ||
21 | private: | ||
22 | /// Stores the various DebugDirectory structures. | ||
23 | std::vector<PELIB_IMG_DEBUG_DIRECTORY> m_vDebugInfo; | ||
24 | |||
25 | std::vector<PELIB_IMG_DEBUG_DIRECTORY> read(InputBuffer& ibBuffer, unsigned int uiSize); | ||
26 | |||
27 | public: | ||
28 | void clear(); // EXPORT | ||
29 | /// Reads the Debug directory from a file. | ||
30 | int read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize); // EXPORT | ||
31 | int read(unsigned char* buffer, unsigned int buffersize); | ||
32 | /// Rebuilds the current Debug directory. | ||
33 | void rebuild(std::vector<byte>& obBuffer) const; // EXPORT | ||
34 | /// Returns the size the current Debug directory needs after rebuilding. | ||
35 | unsigned int size() const; | ||
36 | /// Writes the current Debug directory back to a file. | ||
37 | int write(const std::string& strFilename, unsigned int uiOffset) const; // EXPORT | ||
38 | |||
39 | /// Returns the number of DebugDirectory image structures in the current DebugDirectory. | ||
40 | unsigned int calcNumberOfEntries() const; // EXPORT | ||
41 | |||
42 | /// Adds a new debug structure. | ||
43 | void addEntry(); // EXPORT | ||
44 | /// Removes a debug structure. | ||
45 | void removeEntry(unsigned int uiIndex); // EXPORT | ||
46 | |||
47 | /// Returns the Characteristics value of a debug structure. | ||
48 | dword getCharacteristics(unsigned int uiIndex) const; // EXPORT | ||
49 | /// Returns the TimeDateStamp value of a debug structure. | ||
50 | dword getTimeDateStamp(unsigned int uiIndex) const; // EXPORT | ||
51 | /// Returns the MajorVersion value of a debug structure. | ||
52 | word getMajorVersion(unsigned int uiIndex) const; // EXPORT | ||
53 | /// Returns the MinorVersion value of a debug structure. | ||
54 | word getMinorVersion(unsigned int uiIndex) const; // EXPORT | ||
55 | /// Returns the Type value of a debug structure. | ||
56 | dword getType(unsigned int uiIndex) const; // EXPORT | ||
57 | /// Returns the SizeOfData value of a debug structure. | ||
58 | dword getSizeOfData(unsigned int uiIndex) const; // EXPORT | ||
59 | /// Returns the AddressOfRawData value of a debug structure. | ||
60 | dword getAddressOfRawData(unsigned int uiIndex) const; // EXPORT | ||
61 | /// Returns the PointerToRawData value of a debug structure. | ||
62 | dword getPointerToRawData(unsigned int uiIndex) const; // EXPORT | ||
63 | std::vector<byte> getData(unsigned int index) const; // EXPORT | ||
64 | |||
65 | /// Sets the Characteristics value of a debug structure. | ||
66 | void setCharacteristics(unsigned int uiIndex, dword dwValue); // EXPORT | ||
67 | /// Sets the TimeDateStamp value of a debug structure. | ||
68 | void setTimeDateStamp(unsigned int uiIndex, dword dwValue); // EXPORT | ||
69 | /// Sets the MajorVersion value of a debug structure. | ||
70 | void setMajorVersion(unsigned int uiIndex, word wValue); // EXPORT | ||
71 | /// Sets the MinorVersion value of a debug structure. | ||
72 | void setMinorVersion(unsigned int uiIndex, word wValue); // EXPORT | ||
73 | /// Sets the Type value of a debug structure. | ||
74 | void setType(unsigned int uiIndex, dword dwValue); // EXPORT | ||
75 | /// Sets the SizeOfData value of a debug structure. | ||
76 | void setSizeOfData(unsigned int uiIndex, dword dwValue); // EXPORT | ||
77 | /// Sets the AddressOfRawData value of a debug structure. | ||
78 | void setAddressOfRawData(unsigned int uiIndex, dword dwValue); // EXPORT | ||
79 | /// Sets the PointerToRawData value of a debug structure. | ||
80 | void setPointerToRawData(unsigned int uiIndex, dword dwValue); // EXPORT | ||
81 | void setData(unsigned int index, const std::vector<byte>& data); // EXPORT | ||
82 | }; | ||
83 | } | ||
84 | #endif | ||