diff options
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp')
-rw-r--r--[-rwxr-xr-x] | utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp | 934 |
1 files changed, 467 insertions, 467 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp b/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp index 886348994e..fef12f4d8b 100755..100644 --- a/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp +++ b/utils/zenutils/libraries/pelib-0.9/pelib/ComHeaderDirectory.cpp | |||
@@ -1,467 +1,467 @@ | |||
1 | /* | 1 | /* |
2 | * ComHeaderDirectory.cpp - Part of the PeLib library. | 2 | * ComHeaderDirectory.cpp - 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 | #include "PeLibInc.h" | 13 | #include "PeLibInc.h" |
14 | #include "ComHeaderDirectory.h" | 14 | #include "ComHeaderDirectory.h" |
15 | 15 | ||
16 | namespace PeLib | 16 | namespace PeLib |
17 | { | 17 | { |
18 | void ComHeaderDirectory::read(InputBuffer& inputbuffer) | 18 | void ComHeaderDirectory::read(InputBuffer& inputbuffer) |
19 | { | 19 | { |
20 | PELIB_IMAGE_COR20_HEADER ichCurr; | 20 | PELIB_IMAGE_COR20_HEADER ichCurr; |
21 | 21 | ||
22 | inputbuffer >> ichCurr.cb; | 22 | inputbuffer >> ichCurr.cb; |
23 | inputbuffer >> ichCurr.MajorRuntimeVersion; | 23 | inputbuffer >> ichCurr.MajorRuntimeVersion; |
24 | inputbuffer >> ichCurr.MinorRuntimeVersion; | 24 | inputbuffer >> ichCurr.MinorRuntimeVersion; |
25 | inputbuffer >> ichCurr.MetaData.VirtualAddress; | 25 | inputbuffer >> ichCurr.MetaData.VirtualAddress; |
26 | inputbuffer >> ichCurr.MetaData.Size; | 26 | inputbuffer >> ichCurr.MetaData.Size; |
27 | inputbuffer >> ichCurr.Flags; | 27 | inputbuffer >> ichCurr.Flags; |
28 | inputbuffer >> ichCurr.EntryPointToken; | 28 | inputbuffer >> ichCurr.EntryPointToken; |
29 | inputbuffer >> ichCurr.Resources.VirtualAddress; | 29 | inputbuffer >> ichCurr.Resources.VirtualAddress; |
30 | inputbuffer >> ichCurr.Resources.Size; | 30 | inputbuffer >> ichCurr.Resources.Size; |
31 | inputbuffer >> ichCurr.StrongNameSignature.VirtualAddress; | 31 | inputbuffer >> ichCurr.StrongNameSignature.VirtualAddress; |
32 | inputbuffer >> ichCurr.StrongNameSignature.Size; | 32 | inputbuffer >> ichCurr.StrongNameSignature.Size; |
33 | inputbuffer >> ichCurr.CodeManagerTable.VirtualAddress; | 33 | inputbuffer >> ichCurr.CodeManagerTable.VirtualAddress; |
34 | inputbuffer >> ichCurr.CodeManagerTable.Size; | 34 | inputbuffer >> ichCurr.CodeManagerTable.Size; |
35 | inputbuffer >> ichCurr.VTableFixups.VirtualAddress; | 35 | inputbuffer >> ichCurr.VTableFixups.VirtualAddress; |
36 | inputbuffer >> ichCurr.VTableFixups.Size; | 36 | inputbuffer >> ichCurr.VTableFixups.Size; |
37 | inputbuffer >> ichCurr.ExportAddressTableJumps.VirtualAddress; | 37 | inputbuffer >> ichCurr.ExportAddressTableJumps.VirtualAddress; |
38 | inputbuffer >> ichCurr.ExportAddressTableJumps.Size; | 38 | inputbuffer >> ichCurr.ExportAddressTableJumps.Size; |
39 | inputbuffer >> ichCurr.ManagedNativeHeader.VirtualAddress; | 39 | inputbuffer >> ichCurr.ManagedNativeHeader.VirtualAddress; |
40 | inputbuffer >> ichCurr.ManagedNativeHeader.Size; | 40 | inputbuffer >> ichCurr.ManagedNativeHeader.Size; |
41 | 41 | ||
42 | std::swap(ichCurr, m_ichComHeader); | 42 | std::swap(ichCurr, m_ichComHeader); |
43 | } | 43 | } |
44 | 44 | ||
45 | int ComHeaderDirectory::read(unsigned char* buffer, unsigned int buffersize) | 45 | int ComHeaderDirectory::read(unsigned char* buffer, unsigned int buffersize) |
46 | { | 46 | { |
47 | if (buffersize < PELIB_IMAGE_COR20_HEADER::size()) | 47 | if (buffersize < PELIB_IMAGE_COR20_HEADER::size()) |
48 | { | 48 | { |
49 | return ERROR_INVALID_FILE; | 49 | return ERROR_INVALID_FILE; |
50 | } | 50 | } |
51 | 51 | ||
52 | std::vector<byte> vComDescDirectory(buffer, buffer + buffersize); | 52 | std::vector<byte> vComDescDirectory(buffer, buffer + buffersize); |
53 | 53 | ||
54 | InputBuffer ibBuffer(vComDescDirectory); | 54 | InputBuffer ibBuffer(vComDescDirectory); |
55 | read(ibBuffer); | 55 | read(ibBuffer); |
56 | return NO_ERROR; | 56 | return NO_ERROR; |
57 | } | 57 | } |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * Reads a file's COM+ descriptor. | 60 | * Reads a file's COM+ descriptor. |
61 | * @param strFilename Name of the file. | 61 | * @param strFilename Name of the file. |
62 | * @param uiOffset File offset of the COM+ descriptor. | 62 | * @param uiOffset File offset of the COM+ descriptor. |
63 | * @param uiSize Size of the COM+ descriptor. | 63 | * @param uiSize Size of the COM+ descriptor. |
64 | **/ | 64 | **/ |
65 | int ComHeaderDirectory::read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize) | 65 | int ComHeaderDirectory::read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize) |
66 | { | 66 | { |
67 | std::ifstream ifFile(strFilename.c_str(), std::ios::binary); | 67 | std::ifstream ifFile(strFilename.c_str(), std::ios::binary); |
68 | unsigned int ulFileSize = fileSize(ifFile); | 68 | unsigned int ulFileSize = fileSize(ifFile); |
69 | 69 | ||
70 | if (!ifFile) | 70 | if (!ifFile) |
71 | { | 71 | { |
72 | return ERROR_OPENING_FILE; | 72 | return ERROR_OPENING_FILE; |
73 | } | 73 | } |
74 | 74 | ||
75 | if (ulFileSize < uiOffset + uiSize) | 75 | if (ulFileSize < uiOffset + uiSize) |
76 | { | 76 | { |
77 | return ERROR_INVALID_FILE; | 77 | return ERROR_INVALID_FILE; |
78 | } | 78 | } |
79 | 79 | ||
80 | ifFile.seekg(uiOffset, std::ios::beg); | 80 | ifFile.seekg(uiOffset, std::ios::beg); |
81 | 81 | ||
82 | std::vector<byte> vComDescDirectory(uiSize); | 82 | std::vector<byte> vComDescDirectory(uiSize); |
83 | ifFile.read(reinterpret_cast<char*>(&vComDescDirectory[0]), uiSize); | 83 | ifFile.read(reinterpret_cast<char*>(&vComDescDirectory[0]), uiSize); |
84 | 84 | ||
85 | InputBuffer ibBuffer(vComDescDirectory); | 85 | InputBuffer ibBuffer(vComDescDirectory); |
86 | read(ibBuffer); | 86 | read(ibBuffer); |
87 | return NO_ERROR; | 87 | return NO_ERROR; |
88 | } | 88 | } |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Rebuilds the current COM+ descriptor. | 91 | * Rebuilds the current COM+ descriptor. |
92 | * @param vBuffer Buffer where the COM+ descriptor will be written to. | 92 | * @param vBuffer Buffer where the COM+ descriptor will be written to. |
93 | **/ | 93 | **/ |
94 | void ComHeaderDirectory::rebuild(std::vector<byte>& vBuffer) const | 94 | void ComHeaderDirectory::rebuild(std::vector<byte>& vBuffer) const |
95 | { | 95 | { |
96 | OutputBuffer obBuffer(vBuffer); | 96 | OutputBuffer obBuffer(vBuffer); |
97 | 97 | ||
98 | obBuffer << m_ichComHeader.cb; | 98 | obBuffer << m_ichComHeader.cb; |
99 | obBuffer << m_ichComHeader.MajorRuntimeVersion; | 99 | obBuffer << m_ichComHeader.MajorRuntimeVersion; |
100 | obBuffer << m_ichComHeader.MinorRuntimeVersion; | 100 | obBuffer << m_ichComHeader.MinorRuntimeVersion; |
101 | obBuffer << m_ichComHeader.MetaData.VirtualAddress; | 101 | obBuffer << m_ichComHeader.MetaData.VirtualAddress; |
102 | obBuffer << m_ichComHeader.MetaData.Size; | 102 | obBuffer << m_ichComHeader.MetaData.Size; |
103 | obBuffer << m_ichComHeader.Flags; | 103 | obBuffer << m_ichComHeader.Flags; |
104 | obBuffer << m_ichComHeader.EntryPointToken; | 104 | obBuffer << m_ichComHeader.EntryPointToken; |
105 | obBuffer << m_ichComHeader.Resources.VirtualAddress; | 105 | obBuffer << m_ichComHeader.Resources.VirtualAddress; |
106 | obBuffer << m_ichComHeader.Resources.Size; | 106 | obBuffer << m_ichComHeader.Resources.Size; |
107 | obBuffer << m_ichComHeader.StrongNameSignature.VirtualAddress; | 107 | obBuffer << m_ichComHeader.StrongNameSignature.VirtualAddress; |
108 | obBuffer << m_ichComHeader.StrongNameSignature.Size; | 108 | obBuffer << m_ichComHeader.StrongNameSignature.Size; |
109 | obBuffer << m_ichComHeader.CodeManagerTable.VirtualAddress; | 109 | obBuffer << m_ichComHeader.CodeManagerTable.VirtualAddress; |
110 | obBuffer << m_ichComHeader.CodeManagerTable.Size; | 110 | obBuffer << m_ichComHeader.CodeManagerTable.Size; |
111 | obBuffer << m_ichComHeader.VTableFixups.VirtualAddress; | 111 | obBuffer << m_ichComHeader.VTableFixups.VirtualAddress; |
112 | obBuffer << m_ichComHeader.VTableFixups.Size; | 112 | obBuffer << m_ichComHeader.VTableFixups.Size; |
113 | obBuffer << m_ichComHeader.ExportAddressTableJumps.VirtualAddress; | 113 | obBuffer << m_ichComHeader.ExportAddressTableJumps.VirtualAddress; |
114 | obBuffer << m_ichComHeader.ExportAddressTableJumps.Size; | 114 | obBuffer << m_ichComHeader.ExportAddressTableJumps.Size; |
115 | obBuffer << m_ichComHeader.ManagedNativeHeader.VirtualAddress; | 115 | obBuffer << m_ichComHeader.ManagedNativeHeader.VirtualAddress; |
116 | obBuffer << m_ichComHeader.ManagedNativeHeader.Size; | 116 | obBuffer << m_ichComHeader.ManagedNativeHeader.Size; |
117 | } | 117 | } |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * @return Size in bytes. | 120 | * @return Size in bytes. |
121 | **/ | 121 | **/ |
122 | unsigned int ComHeaderDirectory::size() const | 122 | unsigned int ComHeaderDirectory::size() const |
123 | { | 123 | { |
124 | return PELIB_IMAGE_COR20_HEADER::size(); | 124 | return PELIB_IMAGE_COR20_HEADER::size(); |
125 | } | 125 | } |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * @param strFilename Name of the file. | 128 | * @param strFilename Name of the file. |
129 | * @param dwOffset File offset the COM+ descriptor will be written to. | 129 | * @param dwOffset File offset the COM+ descriptor will be written to. |
130 | **/ | 130 | **/ |
131 | int ComHeaderDirectory::write(const std::string& strFilename, unsigned int dwOffset) const | 131 | int ComHeaderDirectory::write(const std::string& strFilename, unsigned int dwOffset) const |
132 | { | 132 | { |
133 | std::fstream ofFile(strFilename.c_str(), std::ios_base::in); | 133 | std::fstream ofFile(strFilename.c_str(), std::ios_base::in); |
134 | 134 | ||
135 | if (!ofFile) | 135 | if (!ofFile) |
136 | { | 136 | { |
137 | ofFile.clear(); | 137 | ofFile.clear(); |
138 | ofFile.open(strFilename.c_str(), std::ios_base::out | std::ios_base::binary); | 138 | ofFile.open(strFilename.c_str(), std::ios_base::out | std::ios_base::binary); |
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | ofFile.close(); | 142 | ofFile.close(); |
143 | ofFile.open(strFilename.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::binary); | 143 | ofFile.open(strFilename.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::binary); |
144 | } | 144 | } |
145 | 145 | ||
146 | if (!ofFile) | 146 | if (!ofFile) |
147 | { | 147 | { |
148 | return ERROR_OPENING_FILE; | 148 | return ERROR_OPENING_FILE; |
149 | } | 149 | } |
150 | 150 | ||
151 | ofFile.seekp(dwOffset, std::ios::beg); | 151 | ofFile.seekp(dwOffset, std::ios::beg); |
152 | 152 | ||
153 | std::vector<unsigned char> vBuffer; | 153 | std::vector<unsigned char> vBuffer; |
154 | rebuild(vBuffer); | 154 | rebuild(vBuffer); |
155 | 155 | ||
156 | ofFile.write(reinterpret_cast<const char*>(&vBuffer[0]), static_cast<unsigned int>(vBuffer.size())); | 156 | ofFile.write(reinterpret_cast<const char*>(&vBuffer[0]), static_cast<unsigned int>(vBuffer.size())); |
157 | 157 | ||
158 | ofFile.close(); | 158 | ofFile.close(); |
159 | 159 | ||
160 | return NO_ERROR; | 160 | return NO_ERROR; |
161 | } | 161 | } |
162 | 162 | ||
163 | /** | 163 | /** |
164 | * @return SizeOfHeader value of the current COM+ descriptor. | 164 | * @return SizeOfHeader value of the current COM+ descriptor. |
165 | **/ | 165 | **/ |
166 | dword ComHeaderDirectory::getSizeOfHeader() const | 166 | dword ComHeaderDirectory::getSizeOfHeader() const |
167 | { | 167 | { |
168 | return m_ichComHeader.cb; | 168 | return m_ichComHeader.cb; |
169 | } | 169 | } |
170 | 170 | ||
171 | /** | 171 | /** |
172 | * @return MajorRuntimeVersion value of the current COM+ descriptor. | 172 | * @return MajorRuntimeVersion value of the current COM+ descriptor. |
173 | **/ | 173 | **/ |
174 | word ComHeaderDirectory::getMajorRuntimeVersion() const | 174 | word ComHeaderDirectory::getMajorRuntimeVersion() const |
175 | { | 175 | { |
176 | return m_ichComHeader.MajorRuntimeVersion; | 176 | return m_ichComHeader.MajorRuntimeVersion; |
177 | } | 177 | } |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * @return MinorRuntimeVersion value of the current COM+ descriptor. | 180 | * @return MinorRuntimeVersion value of the current COM+ descriptor. |
181 | **/ | 181 | **/ |
182 | word ComHeaderDirectory::getMinorRuntimeVersion() const | 182 | word ComHeaderDirectory::getMinorRuntimeVersion() const |
183 | { | 183 | { |
184 | return m_ichComHeader.MinorRuntimeVersion; | 184 | return m_ichComHeader.MinorRuntimeVersion; |
185 | } | 185 | } |
186 | 186 | ||
187 | /** | 187 | /** |
188 | * @return MetaData (Virtual Address) value of the current COM+ descriptor. | 188 | * @return MetaData (Virtual Address) value of the current COM+ descriptor. |
189 | **/ | 189 | **/ |
190 | dword ComHeaderDirectory::getMetaDataVa() const | 190 | dword ComHeaderDirectory::getMetaDataVa() const |
191 | { | 191 | { |
192 | return m_ichComHeader.MetaData.VirtualAddress; | 192 | return m_ichComHeader.MetaData.VirtualAddress; |
193 | } | 193 | } |
194 | 194 | ||
195 | /** | 195 | /** |
196 | * @return MetaData (Size) value of the current COM+ descriptor. | 196 | * @return MetaData (Size) value of the current COM+ descriptor. |
197 | **/ | 197 | **/ |
198 | dword ComHeaderDirectory::getMetaDataSize() const | 198 | dword ComHeaderDirectory::getMetaDataSize() const |
199 | { | 199 | { |
200 | return m_ichComHeader.MetaData.Size; | 200 | return m_ichComHeader.MetaData.Size; |
201 | } | 201 | } |
202 | 202 | ||
203 | /** | 203 | /** |
204 | * @return Flags value of the current COM+ descriptor. | 204 | * @return Flags value of the current COM+ descriptor. |
205 | **/ | 205 | **/ |
206 | dword ComHeaderDirectory::getFlags() const | 206 | dword ComHeaderDirectory::getFlags() const |
207 | { | 207 | { |
208 | return m_ichComHeader.Flags; | 208 | return m_ichComHeader.Flags; |
209 | } | 209 | } |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * @return EntryPointToken value of the current COM+ descriptor. | 212 | * @return EntryPointToken value of the current COM+ descriptor. |
213 | **/ | 213 | **/ |
214 | dword ComHeaderDirectory::getEntryPointToken() const | 214 | dword ComHeaderDirectory::getEntryPointToken() const |
215 | { | 215 | { |
216 | return m_ichComHeader.EntryPointToken; | 216 | return m_ichComHeader.EntryPointToken; |
217 | } | 217 | } |
218 | 218 | ||
219 | /** | 219 | /** |
220 | * @return Resources (Virtual Address) value of the current COM+ descriptor. | 220 | * @return Resources (Virtual Address) value of the current COM+ descriptor. |
221 | **/ | 221 | **/ |
222 | dword ComHeaderDirectory::getResourcesVa() const | 222 | dword ComHeaderDirectory::getResourcesVa() const |
223 | { | 223 | { |
224 | return m_ichComHeader.Resources.VirtualAddress; | 224 | return m_ichComHeader.Resources.VirtualAddress; |
225 | } | 225 | } |
226 | 226 | ||
227 | /** | 227 | /** |
228 | * @return Resources (Size) value of the current COM+ descriptor. | 228 | * @return Resources (Size) value of the current COM+ descriptor. |
229 | **/ | 229 | **/ |
230 | dword ComHeaderDirectory::getResourcesSize() | 230 | dword ComHeaderDirectory::getResourcesSize() |
231 | { | 231 | { |
232 | return m_ichComHeader.Resources.Size; | 232 | return m_ichComHeader.Resources.Size; |
233 | } | 233 | } |
234 | 234 | ||
235 | /** | 235 | /** |
236 | * @return StrongNameSignature (Virtual Address) value of the current COM+ descriptor. | 236 | * @return StrongNameSignature (Virtual Address) value of the current COM+ descriptor. |
237 | **/ | 237 | **/ |
238 | dword ComHeaderDirectory::getStrongNameSignatureVa() const | 238 | dword ComHeaderDirectory::getStrongNameSignatureVa() const |
239 | { | 239 | { |
240 | return m_ichComHeader.StrongNameSignature.VirtualAddress; | 240 | return m_ichComHeader.StrongNameSignature.VirtualAddress; |
241 | } | 241 | } |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * @return StrongNameSignature (Size) value of the current COM+ descriptor. | 244 | * @return StrongNameSignature (Size) value of the current COM+ descriptor. |
245 | **/ | 245 | **/ |
246 | dword ComHeaderDirectory::getStrongNameSignagureSize() const | 246 | dword ComHeaderDirectory::getStrongNameSignagureSize() const |
247 | { | 247 | { |
248 | return m_ichComHeader.StrongNameSignature.Size; | 248 | return m_ichComHeader.StrongNameSignature.Size; |
249 | } | 249 | } |
250 | 250 | ||
251 | /** | 251 | /** |
252 | * @return CodeManagerTable (Virtual Address) value of the current COM+ descriptor. | 252 | * @return CodeManagerTable (Virtual Address) value of the current COM+ descriptor. |
253 | **/ | 253 | **/ |
254 | dword ComHeaderDirectory::getCodeManagerTableVa() const | 254 | dword ComHeaderDirectory::getCodeManagerTableVa() const |
255 | { | 255 | { |
256 | return m_ichComHeader.CodeManagerTable.VirtualAddress; | 256 | return m_ichComHeader.CodeManagerTable.VirtualAddress; |
257 | } | 257 | } |
258 | 258 | ||
259 | /** | 259 | /** |
260 | * @return CodeManagerTable (Size) value of the current COM+ descriptor. | 260 | * @return CodeManagerTable (Size) value of the current COM+ descriptor. |
261 | **/ | 261 | **/ |
262 | dword ComHeaderDirectory::getCodeManagerTableSize() const | 262 | dword ComHeaderDirectory::getCodeManagerTableSize() const |
263 | { | 263 | { |
264 | return m_ichComHeader.CodeManagerTable.Size; | 264 | return m_ichComHeader.CodeManagerTable.Size; |
265 | } | 265 | } |
266 | 266 | ||
267 | /** | 267 | /** |
268 | * @return VTableFixups (Virtual Address) value of the current COM+ descriptor. | 268 | * @return VTableFixups (Virtual Address) value of the current COM+ descriptor. |
269 | **/ | 269 | **/ |
270 | dword ComHeaderDirectory::getVTableFixupsVa() const | 270 | dword ComHeaderDirectory::getVTableFixupsVa() const |
271 | { | 271 | { |
272 | return m_ichComHeader.VTableFixups.VirtualAddress; | 272 | return m_ichComHeader.VTableFixups.VirtualAddress; |
273 | } | 273 | } |
274 | 274 | ||
275 | /** | 275 | /** |
276 | * @return VTableFixups (Size) value of the current COM+ descriptor. | 276 | * @return VTableFixups (Size) value of the current COM+ descriptor. |
277 | **/ | 277 | **/ |
278 | dword ComHeaderDirectory::getVTableFixupsSize() const | 278 | dword ComHeaderDirectory::getVTableFixupsSize() const |
279 | { | 279 | { |
280 | return m_ichComHeader.VTableFixups.Size; | 280 | return m_ichComHeader.VTableFixups.Size; |
281 | } | 281 | } |
282 | 282 | ||
283 | /** | 283 | /** |
284 | * @return ExportAddressTableJumps (Virtual Address) value of the current COM+ descriptor. | 284 | * @return ExportAddressTableJumps (Virtual Address) value of the current COM+ descriptor. |
285 | **/ | 285 | **/ |
286 | dword ComHeaderDirectory::getExportAddressTableJumpsVa() const | 286 | dword ComHeaderDirectory::getExportAddressTableJumpsVa() const |
287 | { | 287 | { |
288 | return m_ichComHeader.ExportAddressTableJumps.VirtualAddress; | 288 | return m_ichComHeader.ExportAddressTableJumps.VirtualAddress; |
289 | } | 289 | } |
290 | 290 | ||
291 | /** | 291 | /** |
292 | * @return ExportAddressTableJumps (Size) value of the current COM+ descriptor. | 292 | * @return ExportAddressTableJumps (Size) value of the current COM+ descriptor. |
293 | **/ | 293 | **/ |
294 | dword ComHeaderDirectory::getExportAddressTableJumpsSize() const | 294 | dword ComHeaderDirectory::getExportAddressTableJumpsSize() const |
295 | { | 295 | { |
296 | return m_ichComHeader.ExportAddressTableJumps.Size; | 296 | return m_ichComHeader.ExportAddressTableJumps.Size; |
297 | } | 297 | } |
298 | 298 | ||
299 | /** | 299 | /** |
300 | * @return ManagedNativeHeader (Virtual Address) value of the current COM+ descriptor. | 300 | * @return ManagedNativeHeader (Virtual Address) value of the current COM+ descriptor. |
301 | **/ | 301 | **/ |
302 | dword ComHeaderDirectory::getManagedNativeHeaderVa() const | 302 | dword ComHeaderDirectory::getManagedNativeHeaderVa() const |
303 | { | 303 | { |
304 | return m_ichComHeader.ManagedNativeHeader.VirtualAddress; | 304 | return m_ichComHeader.ManagedNativeHeader.VirtualAddress; |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | 307 | /** |
308 | * @return ManagedNativeHeader (Size) value of the current COM+ descriptor. | 308 | * @return ManagedNativeHeader (Size) value of the current COM+ descriptor. |
309 | **/ | 309 | **/ |
310 | dword ComHeaderDirectory::getManagedNativeHeaderSize() const | 310 | dword ComHeaderDirectory::getManagedNativeHeaderSize() const |
311 | { | 311 | { |
312 | return m_ichComHeader.ManagedNativeHeader.Size; | 312 | return m_ichComHeader.ManagedNativeHeader.Size; |
313 | } | 313 | } |
314 | 314 | ||
315 | /** | 315 | /** |
316 | * @param dwValue New value for the current SizeOfHeader (cb) value. | 316 | * @param dwValue New value for the current SizeOfHeader (cb) value. |
317 | **/ | 317 | **/ |
318 | void ComHeaderDirectory::setSizeOfHeader(dword dwValue) | 318 | void ComHeaderDirectory::setSizeOfHeader(dword dwValue) |
319 | { | 319 | { |
320 | m_ichComHeader.cb = dwValue; | 320 | m_ichComHeader.cb = dwValue; |
321 | } | 321 | } |
322 | 322 | ||
323 | /** | 323 | /** |
324 | * @param wValue New value for the current MajorRuntimeVersion value. | 324 | * @param wValue New value for the current MajorRuntimeVersion value. |
325 | **/ | 325 | **/ |
326 | void ComHeaderDirectory::setMajorRuntimeVersion(word wValue) | 326 | void ComHeaderDirectory::setMajorRuntimeVersion(word wValue) |
327 | { | 327 | { |
328 | m_ichComHeader.MajorRuntimeVersion = wValue; | 328 | m_ichComHeader.MajorRuntimeVersion = wValue; |
329 | } | 329 | } |
330 | 330 | ||
331 | /** | 331 | /** |
332 | * @param wValue New value for the current MinorRuntimeVersion value. | 332 | * @param wValue New value for the current MinorRuntimeVersion value. |
333 | **/ | 333 | **/ |
334 | void ComHeaderDirectory::setMinorRuntimeVersion(word wValue) | 334 | void ComHeaderDirectory::setMinorRuntimeVersion(word wValue) |
335 | { | 335 | { |
336 | m_ichComHeader.MinorRuntimeVersion = wValue; | 336 | m_ichComHeader.MinorRuntimeVersion = wValue; |
337 | } | 337 | } |
338 | 338 | ||
339 | /** | 339 | /** |
340 | * @param dwValue New value for the current MetaData (VirtualAddress) value. | 340 | * @param dwValue New value for the current MetaData (VirtualAddress) value. |
341 | **/ | 341 | **/ |
342 | void ComHeaderDirectory::setMetaDataVa(dword dwValue) | 342 | void ComHeaderDirectory::setMetaDataVa(dword dwValue) |
343 | { | 343 | { |
344 | m_ichComHeader.MetaData.VirtualAddress = dwValue; | 344 | m_ichComHeader.MetaData.VirtualAddress = dwValue; |
345 | } | 345 | } |
346 | 346 | ||
347 | /** | 347 | /** |
348 | * @param dwValue New value for the current MetaData (Size) value. | 348 | * @param dwValue New value for the current MetaData (Size) value. |
349 | **/ | 349 | **/ |
350 | void ComHeaderDirectory::setMetaDataSize(dword dwValue) | 350 | void ComHeaderDirectory::setMetaDataSize(dword dwValue) |
351 | { | 351 | { |
352 | m_ichComHeader.MetaData.Size = dwValue; | 352 | m_ichComHeader.MetaData.Size = dwValue; |
353 | } | 353 | } |
354 | 354 | ||
355 | /** | 355 | /** |
356 | * @param dwValue New value for the current Flags value. | 356 | * @param dwValue New value for the current Flags value. |
357 | **/ | 357 | **/ |
358 | void ComHeaderDirectory::setFlags(dword dwValue) | 358 | void ComHeaderDirectory::setFlags(dword dwValue) |
359 | { | 359 | { |
360 | m_ichComHeader.Flags = dwValue; | 360 | m_ichComHeader.Flags = dwValue; |
361 | } | 361 | } |
362 | 362 | ||
363 | /** | 363 | /** |
364 | * @param dwValue New value for the current EntryPointToken value. | 364 | * @param dwValue New value for the current EntryPointToken value. |
365 | **/ | 365 | **/ |
366 | void ComHeaderDirectory::setEntryPointToken(dword dwValue) | 366 | void ComHeaderDirectory::setEntryPointToken(dword dwValue) |
367 | { | 367 | { |
368 | m_ichComHeader.EntryPointToken = dwValue; | 368 | m_ichComHeader.EntryPointToken = dwValue; |
369 | } | 369 | } |
370 | 370 | ||
371 | /** | 371 | /** |
372 | * @param dwValue New value for the current Resources (VirtualAddress) value. | 372 | * @param dwValue New value for the current Resources (VirtualAddress) value. |
373 | **/ | 373 | **/ |
374 | void ComHeaderDirectory::setResourcesVa(dword dwValue) | 374 | void ComHeaderDirectory::setResourcesVa(dword dwValue) |
375 | { | 375 | { |
376 | m_ichComHeader.Resources.VirtualAddress = dwValue; | 376 | m_ichComHeader.Resources.VirtualAddress = dwValue; |
377 | } | 377 | } |
378 | 378 | ||
379 | /** | 379 | /** |
380 | * @param dwValue New value for the current Resources (Size) value. | 380 | * @param dwValue New value for the current Resources (Size) value. |
381 | **/ | 381 | **/ |
382 | void ComHeaderDirectory::setResourcesSize(dword dwValue) | 382 | void ComHeaderDirectory::setResourcesSize(dword dwValue) |
383 | { | 383 | { |
384 | m_ichComHeader.Resources.Size = dwValue; | 384 | m_ichComHeader.Resources.Size = dwValue; |
385 | } | 385 | } |
386 | 386 | ||
387 | /** | 387 | /** |
388 | * @param dwValue New value for the current StrongNameSignature (VirtualAddress) value. | 388 | * @param dwValue New value for the current StrongNameSignature (VirtualAddress) value. |
389 | **/ | 389 | **/ |
390 | void ComHeaderDirectory::setStrongNameSignatureVa(dword dwValue) | 390 | void ComHeaderDirectory::setStrongNameSignatureVa(dword dwValue) |
391 | { | 391 | { |
392 | m_ichComHeader.StrongNameSignature.VirtualAddress = dwValue; | 392 | m_ichComHeader.StrongNameSignature.VirtualAddress = dwValue; |
393 | } | 393 | } |
394 | 394 | ||
395 | /** | 395 | /** |
396 | * @param dwValue New value for the current StrongNameSignature (Size) value. | 396 | * @param dwValue New value for the current StrongNameSignature (Size) value. |
397 | **/ | 397 | **/ |
398 | void ComHeaderDirectory::setStrongNameSignagureSize(dword dwValue) | 398 | void ComHeaderDirectory::setStrongNameSignagureSize(dword dwValue) |
399 | { | 399 | { |
400 | m_ichComHeader.StrongNameSignature.Size = dwValue; | 400 | m_ichComHeader.StrongNameSignature.Size = dwValue; |
401 | } | 401 | } |
402 | 402 | ||
403 | /** | 403 | /** |
404 | * @param dwValue New value for the current CodeManagerTable (VirtualAddress) value. | 404 | * @param dwValue New value for the current CodeManagerTable (VirtualAddress) value. |
405 | **/ | 405 | **/ |
406 | void ComHeaderDirectory::setCodeManagerTableVa(dword dwValue) | 406 | void ComHeaderDirectory::setCodeManagerTableVa(dword dwValue) |
407 | { | 407 | { |
408 | m_ichComHeader.CodeManagerTable.VirtualAddress = dwValue; | 408 | m_ichComHeader.CodeManagerTable.VirtualAddress = dwValue; |
409 | } | 409 | } |
410 | 410 | ||
411 | /** | 411 | /** |
412 | * @param dwValue New value for the current CodeManagerTable (Size) value. | 412 | * @param dwValue New value for the current CodeManagerTable (Size) value. |
413 | **/ | 413 | **/ |
414 | void ComHeaderDirectory::setCodeManagerTableSize(dword dwValue) | 414 | void ComHeaderDirectory::setCodeManagerTableSize(dword dwValue) |
415 | { | 415 | { |
416 | m_ichComHeader.CodeManagerTable.Size = dwValue; | 416 | m_ichComHeader.CodeManagerTable.Size = dwValue; |
417 | } | 417 | } |
418 | 418 | ||
419 | /** | 419 | /** |
420 | * @param dwValue New value for the current VTableFixups (VirtualAddress) value. | 420 | * @param dwValue New value for the current VTableFixups (VirtualAddress) value. |
421 | **/ | 421 | **/ |
422 | void ComHeaderDirectory::setVTableFixupsVa(dword dwValue) | 422 | void ComHeaderDirectory::setVTableFixupsVa(dword dwValue) |
423 | { | 423 | { |
424 | m_ichComHeader.VTableFixups.VirtualAddress = dwValue; | 424 | m_ichComHeader.VTableFixups.VirtualAddress = dwValue; |
425 | } | 425 | } |
426 | 426 | ||
427 | /** | 427 | /** |
428 | * @param dwValue New value for the current VTableFixups (Size) value. | 428 | * @param dwValue New value for the current VTableFixups (Size) value. |
429 | **/ | 429 | **/ |
430 | void ComHeaderDirectory::setVTableFixupsSize(dword dwValue) | 430 | void ComHeaderDirectory::setVTableFixupsSize(dword dwValue) |
431 | { | 431 | { |
432 | m_ichComHeader.VTableFixups.Size = dwValue; | 432 | m_ichComHeader.VTableFixups.Size = dwValue; |
433 | } | 433 | } |
434 | 434 | ||
435 | /** | 435 | /** |
436 | * @param dwValue New value for the current ExportAddressTableJumps (VirtualAddress) value. | 436 | * @param dwValue New value for the current ExportAddressTableJumps (VirtualAddress) value. |
437 | **/ | 437 | **/ |
438 | void ComHeaderDirectory::setExportAddressTableJumpsVa(dword dwValue) | 438 | void ComHeaderDirectory::setExportAddressTableJumpsVa(dword dwValue) |
439 | { | 439 | { |
440 | m_ichComHeader.ExportAddressTableJumps.VirtualAddress = dwValue; | 440 | m_ichComHeader.ExportAddressTableJumps.VirtualAddress = dwValue; |
441 | } | 441 | } |
442 | 442 | ||
443 | /** | 443 | /** |
444 | * @param dwValue New value for the current ExportAddressTableJumps (Size) value. | 444 | * @param dwValue New value for the current ExportAddressTableJumps (Size) value. |
445 | **/ | 445 | **/ |
446 | void ComHeaderDirectory::setExportAddressTableJumpsSize(dword dwValue) | 446 | void ComHeaderDirectory::setExportAddressTableJumpsSize(dword dwValue) |
447 | { | 447 | { |
448 | m_ichComHeader.ExportAddressTableJumps.Size = dwValue; | 448 | m_ichComHeader.ExportAddressTableJumps.Size = dwValue; |
449 | } | 449 | } |
450 | 450 | ||
451 | /** | 451 | /** |
452 | * @param dwValue New value for the current ManagedNativeHeader (VirtualAddress) value. | 452 | * @param dwValue New value for the current ManagedNativeHeader (VirtualAddress) value. |
453 | **/ | 453 | **/ |
454 | void ComHeaderDirectory::setManagedNativeHeaderVa(dword dwValue) | 454 | void ComHeaderDirectory::setManagedNativeHeaderVa(dword dwValue) |
455 | { | 455 | { |
456 | m_ichComHeader.ManagedNativeHeader.VirtualAddress = dwValue; | 456 | m_ichComHeader.ManagedNativeHeader.VirtualAddress = dwValue; |
457 | } | 457 | } |
458 | 458 | ||
459 | /** | 459 | /** |
460 | * @param dwValue New value for the current ManagedNativeHeader (Size) value. | 460 | * @param dwValue New value for the current ManagedNativeHeader (Size) value. |
461 | **/ | 461 | **/ |
462 | void ComHeaderDirectory::setManagedNativeHeaderSize(dword dwValue) | 462 | void ComHeaderDirectory::setManagedNativeHeaderSize(dword dwValue) |
463 | { | 463 | { |
464 | m_ichComHeader.ManagedNativeHeader.Size = dwValue; | 464 | m_ichComHeader.ManagedNativeHeader.Size = dwValue; |
465 | } | 465 | } |
466 | 466 | ||
467 | } | 467 | } |