summaryrefslogtreecommitdiff
path: root/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h')
-rwxr-xr-xutils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h b/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h
new file mode 100755
index 0000000000..915813c1cc
--- /dev/null
+++ b/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.h
@@ -0,0 +1,120 @@
1/*
2* ComHeaderDirectory.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 COMHEADERDIRECTORY_H
14#define COMHEADERDIRECTORY_H
15
16namespace PeLib
17{
18 /// Class that handles the COM+ descriptor directory.
19 /**
20 * This class handles the COM+ Descriptor directory which was added to PE files
21 * which work with the .NET runtime modules.
22 **/
23 class ComHeaderDirectory
24 {
25 private:
26 PELIB_IMAGE_COR20_HEADER m_ichComHeader; ///< The COM+ descriptor.
27
28 void read(InputBuffer& inputbuffer);
29
30 public:
31 /// Read a file's COM+ runtime descriptor directory.
32 int read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize); // EXPORT
33 int read(unsigned char* buffer, unsigned int buffersize); // EXPORT
34 /// Rebuild the COM+ descriptor.
35 void rebuild(std::vector<byte>& vBuffer) const; // EXPORT
36 /// Returns the size of the current COM+ descriptor.
37 unsigned int size() const; // EXPORT
38 /// Writes the current COM+ descriptor directory to a file.
39 int write(const std::string& strFilename, unsigned int dwOffset) const; // EXPORT
40
41 /// Get the COM+ descriptor's SizeOfHeader (cb) value.
42 dword getSizeOfHeader() const; // EXPORT
43 /// Get the COM+ descriptor's MajorRuntimeVersion value.
44 word getMajorRuntimeVersion() const; // EXPORT
45 /// Get the COM+ descriptor's MinorRuntimeVersion value.
46 word getMinorRuntimeVersion() const; // EXPORT
47 /// Get the COM+ descriptor's MetaData (Virtual Address) value.
48 dword getMetaDataVa() const; // EXPORT
49 /// Get the COM+ descriptor's MetaData (Size) value.
50 dword getMetaDataSize() const; // EXPORT
51 /// Get the COM+ descriptor's Flags value.
52 dword getFlags() const; // EXPORT
53 /// Get the COM+ descriptor's EntryPointToken value.
54 dword getEntryPointToken() const; // EXPORT
55 /// Get the COM+ descriptor's Resources (Virtual Address) value.
56 dword getResourcesVa() const; // EXPORT
57 /// Get the COM+ descriptor's Resources (Size) value.
58 dword getResourcesSize(); // EXPORT
59 /// Get the COM+ descriptor's StrongNameSignature (Virtual Address) value.
60 dword getStrongNameSignatureVa() const; // EXPORT
61 /// Get the COM+ descriptor's StrongNameSignature (Size) value.
62 dword getStrongNameSignagureSize() const; // EXPORT
63 /// Get the COM+ descriptor's CodeManagerTable (Virtual Address) value.
64 dword getCodeManagerTableVa() const; // EXPORT
65 /// Get the COM+ descriptor's CodeManagerTable (Size) value.
66 dword getCodeManagerTableSize() const; // EXPORT
67 /// Get the COM+ descriptor's VTableFixup (Virtual Address) value.
68 dword getVTableFixupsVa() const; // EXPORT
69 /// Get the COM+ descriptor's VTableFixup (Size) value.
70 dword getVTableFixupsSize() const; // EXPORT
71 /// Get the COM+ descriptor's ExportAddressTable (Virtual Address) value.
72 dword getExportAddressTableJumpsVa() const; // EXPORT
73 /// Get the COM+ descriptor's ExportAddressTable (Size) value.
74 dword getExportAddressTableJumpsSize() const; // EXPORT
75 /// Get the COM+ descriptor's ManagedNativeHeader (Virtual Address) value.
76 dword getManagedNativeHeaderVa() const; // EXPORT
77 /// Get the COM+ descriptor's ManagedNativeHeader (Size) value.
78 dword getManagedNativeHeaderSize() const; // EXPORT
79
80 /// Change the COM+ descriptor's SizeOfHeader (cb) value.
81 void setSizeOfHeader(dword dwValue); // EXPORT
82 /// Change the COM+ descriptor's MajorRuntimeVersion value.
83 void setMajorRuntimeVersion(word wValue); // EXPORT
84 /// Change the COM+ descriptor's MinorRuntimeVersion value.
85 void setMinorRuntimeVersion(word wValue); // EXPORT
86 /// Change the COM+ descriptor's MetaData (VirtualAddress) value.
87 void setMetaDataVa(dword dwValue); // EXPORT
88 /// Change the COM+ descriptor's MetaData (Size) value.
89 void setMetaDataSize(dword dwValue); // EXPORT
90 /// Change the COM+ descriptor's Flags value.
91 void setFlags(dword dwValue); // EXPORT
92 /// Change the COM+ descriptor's EntryPointToken value.
93 void setEntryPointToken(dword dwValue); // EXPORT
94 /// Change the COM+ descriptor's Resources (VirtualAddress) value.
95 void setResourcesVa(dword dwValue); // EXPORT
96 /// Change the COM+ descriptor's Resources (Size) value.
97 void setResourcesSize(dword dwValue); // EXPORT
98 /// Change the COM+ descriptor's StrongNameSignatureVa (VirtualAddress) value.
99 void setStrongNameSignatureVa(dword dwValue); // EXPORT
100 /// Change the COM+ descriptor's StrongNameSignatureVa (Size) value.
101 void setStrongNameSignagureSize(dword dwValue); // EXPORT
102 /// Change the COM+ descriptor's CodeManagerTable (VirtualAddress) value.
103 void setCodeManagerTableVa(dword dwValue); // EXPORT
104 /// Change the COM+ descriptor's CodeManagerTable (Size) value.
105 void setCodeManagerTableSize(dword dwValue); // EXPORT
106 /// Change the COM+ descriptor's VTableFixups (VirtualAddress) value.
107 void setVTableFixupsVa(dword dwValue); // EXPORT
108 /// Change the COM+ descriptor's VTableFixups (Size) value.
109 void setVTableFixupsSize(dword dwValue); // EXPORT
110 /// Change the COM+ descriptor's ExportAddressTableJumps (VirtualAddress) value.
111 void setExportAddressTableJumpsVa(dword dwValue); // EXPORT
112 /// Change the COM+ descriptor's ExportAddressTableJumps (Size) value.
113 void setExportAddressTableJumpsSize(dword dwValue); // EXPORT
114 /// Change the COM+ descriptor's ManagedNativeHeader (VirtualAddress) value.
115 void setManagedNativeHeaderVa(dword dwValue); // EXPORT
116 /// Change the COM+ descriptor's ManagedNativeHeader (Size) value.
117 void setManagedNativeHeaderSize(dword dwValue); // EXPORT
118 };
119}
120#endif