summaryrefslogtreecommitdiff
path: root/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2008-07-11 16:51:25 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2008-07-11 16:51:25 +0000
commitca5bb76d2b8f65aa97e50b633f828c1deb241526 (patch)
tree453a1b2de3a0dc0d0b2f7080d10d033bf8fbcdf1 /utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp
parent141774be48940d56e3ad4dbf451d245b61d4f8b2 (diff)
downloadrockbox-ca5bb76d2b8f65aa97e50b633f828c1deb241526.tar.gz
rockbox-ca5bb76d2b8f65aa97e50b633f828c1deb241526.zip
Delete the svn:executable property and set svn:eol-style to native for all those text files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18012 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp')
-rw-r--r--[-rwxr-xr-x]utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp766
1 files changed, 383 insertions, 383 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp b/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp
index eb3d5c5600..9a91c7b18c 100755..100644
--- a/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp
+++ b/utils/zenutils/libraries/pelib-0.9/pelib/DebugDirectory.cpp
@@ -1,383 +1,383 @@
1/* 1/*
2* DebugDirectory.cpp - Part of the PeLib library. 2* DebugDirectory.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 "DebugDirectory.h" 14#include "DebugDirectory.h"
15 15
16namespace PeLib 16namespace PeLib
17{ 17{
18 void DebugDirectory::clear() 18 void DebugDirectory::clear()
19 { 19 {
20 m_vDebugInfo.clear(); 20 m_vDebugInfo.clear();
21 } 21 }
22 22
23 std::vector<PELIB_IMG_DEBUG_DIRECTORY> DebugDirectory::read(InputBuffer& ibBuffer, unsigned int uiSize) 23 std::vector<PELIB_IMG_DEBUG_DIRECTORY> DebugDirectory::read(InputBuffer& ibBuffer, unsigned int uiSize)
24 { 24 {
25 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo; 25 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo;
26 26
27 PELIB_IMG_DEBUG_DIRECTORY iddCurr; 27 PELIB_IMG_DEBUG_DIRECTORY iddCurr;
28 28
29 for (unsigned int i=0;i<uiSize/PELIB_IMAGE_DEBUG_DIRECTORY::size();i++) 29 for (unsigned int i=0;i<uiSize/PELIB_IMAGE_DEBUG_DIRECTORY::size();i++)
30 { 30 {
31 31
32 ibBuffer >> iddCurr.idd.Characteristics; 32 ibBuffer >> iddCurr.idd.Characteristics;
33 ibBuffer >> iddCurr.idd.TimeDateStamp; 33 ibBuffer >> iddCurr.idd.TimeDateStamp;
34 ibBuffer >> iddCurr.idd.MajorVersion; 34 ibBuffer >> iddCurr.idd.MajorVersion;
35 ibBuffer >> iddCurr.idd.MinorVersion; 35 ibBuffer >> iddCurr.idd.MinorVersion;
36 ibBuffer >> iddCurr.idd.Type; 36 ibBuffer >> iddCurr.idd.Type;
37 ibBuffer >> iddCurr.idd.SizeOfData; 37 ibBuffer >> iddCurr.idd.SizeOfData;
38 ibBuffer >> iddCurr.idd.AddressOfRawData; 38 ibBuffer >> iddCurr.idd.AddressOfRawData;
39 ibBuffer >> iddCurr.idd.PointerToRawData; 39 ibBuffer >> iddCurr.idd.PointerToRawData;
40 40
41 currDebugInfo.push_back(iddCurr); 41 currDebugInfo.push_back(iddCurr);
42 } 42 }
43 43
44 return currDebugInfo; 44 return currDebugInfo;
45 } 45 }
46 46
47 int DebugDirectory::read(unsigned char* buffer, unsigned int buffersize) 47 int DebugDirectory::read(unsigned char* buffer, unsigned int buffersize)
48 { 48 {
49 // XXX: Note, debug data is not read at all. This might or might not change 49 // XXX: Note, debug data is not read at all. This might or might not change
50 // in the future. 50 // in the future.
51 51
52 std::vector<byte> vDebugDirectory(buffer, buffer + buffersize); 52 std::vector<byte> vDebugDirectory(buffer, buffer + buffersize);
53 53
54 InputBuffer ibBuffer(vDebugDirectory); 54 InputBuffer ibBuffer(vDebugDirectory);
55 55
56 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo = read(ibBuffer, buffersize); 56 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo = read(ibBuffer, buffersize);
57 57
58 std::swap(currDebugInfo, m_vDebugInfo); 58 std::swap(currDebugInfo, m_vDebugInfo);
59 59
60 return NO_ERROR; 60 return NO_ERROR;
61 } 61 }
62 62
63 /** 63 /**
64 * @param strFilename Name of the file which will be read. 64 * @param strFilename Name of the file which will be read.
65 * @param uiOffset File offset of the Debug directory. 65 * @param uiOffset File offset of the Debug directory.
66 * @param uiSize Size of the Debug directory. 66 * @param uiSize Size of the Debug directory.
67 **/ 67 **/
68 int DebugDirectory::read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize) 68 int DebugDirectory::read(const std::string& strFilename, unsigned int uiOffset, unsigned int uiSize)
69 { 69 {
70 std::ifstream ifFile(strFilename.c_str(), std::ios::binary); 70 std::ifstream ifFile(strFilename.c_str(), std::ios::binary);
71 unsigned int ulFileSize = fileSize(ifFile); 71 unsigned int ulFileSize = fileSize(ifFile);
72 72
73 if (!ifFile) 73 if (!ifFile)
74 { 74 {
75 return ERROR_OPENING_FILE; 75 return ERROR_OPENING_FILE;
76 } 76 }
77 77
78 if (ulFileSize < uiOffset + uiSize) 78 if (ulFileSize < uiOffset + uiSize)
79 { 79 {
80 return ERROR_INVALID_FILE; 80 return ERROR_INVALID_FILE;
81 } 81 }
82 82
83 ifFile.seekg(uiOffset, std::ios::beg); 83 ifFile.seekg(uiOffset, std::ios::beg);
84 84
85 std::vector<byte> vDebugDirectory(uiSize); 85 std::vector<byte> vDebugDirectory(uiSize);
86 ifFile.read(reinterpret_cast<char*>(&vDebugDirectory[0]), uiSize); 86 ifFile.read(reinterpret_cast<char*>(&vDebugDirectory[0]), uiSize);
87 87
88 InputBuffer ibBuffer(vDebugDirectory); 88 InputBuffer ibBuffer(vDebugDirectory);
89 89
90 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo = read(ibBuffer, uiSize); 90 std::vector<PELIB_IMG_DEBUG_DIRECTORY> currDebugInfo = read(ibBuffer, uiSize);
91 91
92 for (unsigned int i=0;i<currDebugInfo.size();i++) 92 for (unsigned int i=0;i<currDebugInfo.size();i++)
93 { 93 {
94 ifFile.seekg(currDebugInfo[i].idd.PointerToRawData, std::ios::beg); 94 ifFile.seekg(currDebugInfo[i].idd.PointerToRawData, std::ios::beg);
95 currDebugInfo[i].data.resize(currDebugInfo[i].idd.SizeOfData); 95 currDebugInfo[i].data.resize(currDebugInfo[i].idd.SizeOfData);
96 ifFile.read(reinterpret_cast<char*>(&currDebugInfo[i].data[0]), currDebugInfo[i].idd.SizeOfData); 96 ifFile.read(reinterpret_cast<char*>(&currDebugInfo[i].data[0]), currDebugInfo[i].idd.SizeOfData);
97 if (!ifFile) return ERROR_INVALID_FILE; 97 if (!ifFile) return ERROR_INVALID_FILE;
98 } 98 }
99 99
100 std::swap(currDebugInfo, m_vDebugInfo); 100 std::swap(currDebugInfo, m_vDebugInfo);
101 101
102 return NO_ERROR; 102 return NO_ERROR;
103 } 103 }
104 104
105 /** 105 /**
106 * Rebuilds the current debug directory. 106 * Rebuilds the current debug directory.
107 * @param vBuffer Buffer where the rebuilt directory is stored. 107 * @param vBuffer Buffer where the rebuilt directory is stored.
108 **/ 108 **/
109 void DebugDirectory::rebuild(std::vector<byte>& vBuffer) const 109 void DebugDirectory::rebuild(std::vector<byte>& vBuffer) const
110 { 110 {
111 OutputBuffer obBuffer(vBuffer); 111 OutputBuffer obBuffer(vBuffer);
112 112
113 for (unsigned int i=0;i<m_vDebugInfo.size();i++) 113 for (unsigned int i=0;i<m_vDebugInfo.size();i++)
114 { 114 {
115 obBuffer << m_vDebugInfo[i].idd.Characteristics; 115 obBuffer << m_vDebugInfo[i].idd.Characteristics;
116 obBuffer << m_vDebugInfo[i].idd.TimeDateStamp; 116 obBuffer << m_vDebugInfo[i].idd.TimeDateStamp;
117 obBuffer << m_vDebugInfo[i].idd.MajorVersion; 117 obBuffer << m_vDebugInfo[i].idd.MajorVersion;
118 obBuffer << m_vDebugInfo[i].idd.MinorVersion; 118 obBuffer << m_vDebugInfo[i].idd.MinorVersion;
119 obBuffer << m_vDebugInfo[i].idd.Type; 119 obBuffer << m_vDebugInfo[i].idd.Type;
120 obBuffer << m_vDebugInfo[i].idd.SizeOfData; 120 obBuffer << m_vDebugInfo[i].idd.SizeOfData;
121 obBuffer << m_vDebugInfo[i].idd.AddressOfRawData; 121 obBuffer << m_vDebugInfo[i].idd.AddressOfRawData;
122 obBuffer << m_vDebugInfo[i].idd.PointerToRawData; 122 obBuffer << m_vDebugInfo[i].idd.PointerToRawData;
123 } 123 }
124 } 124 }
125 125
126 /** 126 /**
127 * @return Size of the debug directory. 127 * @return Size of the debug directory.
128 **/ 128 **/
129 unsigned int DebugDirectory::size() const 129 unsigned int DebugDirectory::size() const
130 { 130 {
131 return static_cast<unsigned int>(m_vDebugInfo.size()) * PELIB_IMAGE_DEBUG_DIRECTORY::size(); 131 return static_cast<unsigned int>(m_vDebugInfo.size()) * PELIB_IMAGE_DEBUG_DIRECTORY::size();
132 } 132 }
133 133
134 /** 134 /**
135 * @param strFilename Name of the file which will be written. 135 * @param strFilename Name of the file which will be written.
136 * @param uiOffset File offset where the debug directory will be stored. 136 * @param uiOffset File offset where the debug directory will be stored.
137 **/ 137 **/
138 int DebugDirectory::write(const std::string& strFilename, unsigned int uiOffset) const 138 int DebugDirectory::write(const std::string& strFilename, unsigned int uiOffset) const
139 { 139 {
140 std::fstream ofFile(strFilename.c_str(), std::ios_base::in); 140 std::fstream ofFile(strFilename.c_str(), std::ios_base::in);
141 141
142 if (!ofFile) 142 if (!ofFile)
143 { 143 {
144 ofFile.clear(); 144 ofFile.clear();
145 ofFile.open(strFilename.c_str(), std::ios_base::out | std::ios_base::binary); 145 ofFile.open(strFilename.c_str(), std::ios_base::out | std::ios_base::binary);
146 } 146 }
147 else 147 else
148 { 148 {
149 ofFile.close(); 149 ofFile.close();
150 ofFile.open(strFilename.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::binary); 150 ofFile.open(strFilename.c_str(), std::ios_base::in | std::ios_base::out | std::ios_base::binary);
151 } 151 }
152 152
153 if (!ofFile) 153 if (!ofFile)
154 { 154 {
155 return ERROR_OPENING_FILE; 155 return ERROR_OPENING_FILE;
156 } 156 }
157 157
158 ofFile.seekp(uiOffset, std::ios::beg); 158 ofFile.seekp(uiOffset, std::ios::beg);
159 159
160 std::vector<unsigned char> vBuffer; 160 std::vector<unsigned char> vBuffer;
161 rebuild(vBuffer); 161 rebuild(vBuffer);
162 162
163 ofFile.write(reinterpret_cast<const char*>(&vBuffer[0]), static_cast<unsigned int>(vBuffer.size())); 163 ofFile.write(reinterpret_cast<const char*>(&vBuffer[0]), static_cast<unsigned int>(vBuffer.size()));
164 164
165 ofFile.close(); 165 ofFile.close();
166 166
167 return NO_ERROR; 167 return NO_ERROR;
168 } 168 }
169 169
170 /** 170 /**
171 * @return Number of debug structures in the current Debug directory. 171 * @return Number of debug structures in the current Debug directory.
172 **/ 172 **/
173 unsigned int DebugDirectory::calcNumberOfEntries() const 173 unsigned int DebugDirectory::calcNumberOfEntries() const
174 { 174 {
175 return static_cast<unsigned int>(m_vDebugInfo.size()); 175 return static_cast<unsigned int>(m_vDebugInfo.size());
176 } 176 }
177 177
178 /** 178 /**
179 * Adds a new debug structure to the debug directory. The initial values of all members of the structure 179 * Adds a new debug structure to the debug directory. The initial values of all members of the structure
180 * are undefined. 180 * are undefined.
181 **/ 181 **/
182 void DebugDirectory::addEntry() 182 void DebugDirectory::addEntry()
183 { 183 {
184 PELIB_IMG_DEBUG_DIRECTORY p; 184 PELIB_IMG_DEBUG_DIRECTORY p;
185 m_vDebugInfo.push_back(p); 185 m_vDebugInfo.push_back(p);
186 } 186 }
187 187
188 /** 188 /**
189 * Removes a debug structure from the current debug directory. If an invalid structure is specified 189 * Removes a debug structure from the current debug directory. If an invalid structure is specified
190 * by the parameter uiIndex the result will be undefined behaviour. 190 * by the parameter uiIndex the result will be undefined behaviour.
191 * @param uiIndex Identifies the debug structure. 191 * @param uiIndex Identifies the debug structure.
192 **/ 192 **/
193 void DebugDirectory::removeEntry(unsigned int uiIndex) 193 void DebugDirectory::removeEntry(unsigned int uiIndex)
194 { 194 {
195 m_vDebugInfo.erase(m_vDebugInfo.begin() + uiIndex); 195 m_vDebugInfo.erase(m_vDebugInfo.begin() + uiIndex);
196 } 196 }
197 197
198 /** 198 /**
199 * Returns the Characteristics value of a debug structure. If an invalid structure is specified 199 * Returns the Characteristics value of a debug structure. If an invalid structure is specified
200 * by the parameter uiIndex the result will be undefined behaviour. 200 * by the parameter uiIndex the result will be undefined behaviour.
201 * @param uiIndex Identifies the debug structure. 201 * @param uiIndex Identifies the debug structure.
202 * @return Characteristics value of the debug structure. 202 * @return Characteristics value of the debug structure.
203 **/ 203 **/
204 dword DebugDirectory::getCharacteristics(unsigned int uiIndex) const 204 dword DebugDirectory::getCharacteristics(unsigned int uiIndex) const
205 { 205 {
206 return m_vDebugInfo[uiIndex].idd.Characteristics; 206 return m_vDebugInfo[uiIndex].idd.Characteristics;
207 } 207 }
208 208
209 /** 209 /**
210 * Returns the TimeDateStamp value of a debug structure. If an invalid structure is specified 210 * Returns the TimeDateStamp value of a debug structure. If an invalid structure is specified
211 * by the parameter uiIndex the result will be undefined behaviour. 211 * by the parameter uiIndex the result will be undefined behaviour.
212 * @param uiIndex Identifies the debug structure. 212 * @param uiIndex Identifies the debug structure.
213 * @return TimeDateStamp value of the debug structure. 213 * @return TimeDateStamp value of the debug structure.
214 **/ 214 **/
215 dword DebugDirectory::getTimeDateStamp(unsigned int uiIndex) const 215 dword DebugDirectory::getTimeDateStamp(unsigned int uiIndex) const
216 { 216 {
217 return m_vDebugInfo[uiIndex].idd.TimeDateStamp; 217 return m_vDebugInfo[uiIndex].idd.TimeDateStamp;
218 } 218 }
219 219
220 /** 220 /**
221 * Returns the MajorVersion value of a debug structure. If an invalid structure is specified 221 * Returns the MajorVersion value of a debug structure. If an invalid structure is specified
222 * by the parameter uiIndex the result will be undefined behaviour. 222 * by the parameter uiIndex the result will be undefined behaviour.
223 * @param uiIndex Identifies the debug structure. 223 * @param uiIndex Identifies the debug structure.
224 * @return MajorVersion value of the debug structure. 224 * @return MajorVersion value of the debug structure.
225 **/ 225 **/
226 word DebugDirectory::getMajorVersion(unsigned int uiIndex) const 226 word DebugDirectory::getMajorVersion(unsigned int uiIndex) const
227 { 227 {
228 return m_vDebugInfo[uiIndex].idd.MajorVersion; 228 return m_vDebugInfo[uiIndex].idd.MajorVersion;
229 } 229 }
230 230
231 /** 231 /**
232 * Returns the MinorVersion value of a debug structure. If an invalid structure is specified 232 * Returns the MinorVersion value of a debug structure. If an invalid structure is specified
233 * by the parameter uiIndex the result will be undefined behaviour. 233 * by the parameter uiIndex the result will be undefined behaviour.
234 * @param uiIndex Identifies the debug structure. 234 * @param uiIndex Identifies the debug structure.
235 * @return MinorVersion value of the debug structure. 235 * @return MinorVersion value of the debug structure.
236 **/ 236 **/
237 word DebugDirectory::getMinorVersion(unsigned int uiIndex) const 237 word DebugDirectory::getMinorVersion(unsigned int uiIndex) const
238 { 238 {
239 return m_vDebugInfo[uiIndex].idd.MinorVersion; 239 return m_vDebugInfo[uiIndex].idd.MinorVersion;
240 } 240 }
241 241
242 /** 242 /**
243 * Returns the Type value of a debug structure. If an invalid structure is specified 243 * Returns the Type value of a debug structure. If an invalid structure is specified
244 * by the parameter uiIndex the result will be undefined behaviour. 244 * by the parameter uiIndex the result will be undefined behaviour.
245 * @param uiIndex Identifies the debug structure. 245 * @param uiIndex Identifies the debug structure.
246 * @return Type value of the debug structure. 246 * @return Type value of the debug structure.
247 **/ 247 **/
248 dword DebugDirectory::getType(unsigned int uiIndex) const 248 dword DebugDirectory::getType(unsigned int uiIndex) const
249 { 249 {
250 return m_vDebugInfo[uiIndex].idd.Type; 250 return m_vDebugInfo[uiIndex].idd.Type;
251 } 251 }
252 252
253 /** 253 /**
254 * Returns the SizeOfData value of a debug structure. If an invalid structure is specified 254 * Returns the SizeOfData value of a debug structure. If an invalid structure is specified
255 * by the parameter uiIndex the result will be undefined behaviour. 255 * by the parameter uiIndex the result will be undefined behaviour.
256 * @param uiIndex Identifies the debug structure. 256 * @param uiIndex Identifies the debug structure.
257 * @return SizeOfData value of the debug structure. 257 * @return SizeOfData value of the debug structure.
258 **/ 258 **/
259 dword DebugDirectory::getSizeOfData(unsigned int uiIndex) const 259 dword DebugDirectory::getSizeOfData(unsigned int uiIndex) const
260 { 260 {
261 return m_vDebugInfo[uiIndex].idd.SizeOfData; 261 return m_vDebugInfo[uiIndex].idd.SizeOfData;
262 } 262 }
263 263
264 /** 264 /**
265 * Returns the AddressOfRawData value of a debug structure. If an invalid structure is specified 265 * Returns the AddressOfRawData value of a debug structure. If an invalid structure is specified
266 * by the parameter uiIndex the result will be undefined behaviour. 266 * by the parameter uiIndex the result will be undefined behaviour.
267 * @param uiIndex Identifies the debug structure. 267 * @param uiIndex Identifies the debug structure.
268 * @return AddressOfRawData value of the debug structure. 268 * @return AddressOfRawData value of the debug structure.
269 **/ 269 **/
270 dword DebugDirectory::getAddressOfRawData(unsigned int uiIndex) const 270 dword DebugDirectory::getAddressOfRawData(unsigned int uiIndex) const
271 { 271 {
272 return m_vDebugInfo[uiIndex].idd.AddressOfRawData; 272 return m_vDebugInfo[uiIndex].idd.AddressOfRawData;
273 } 273 }
274 274
275 /** 275 /**
276 * Returns the PointerToRawData value of a debug structure. If an invalid structure is specified 276 * Returns the PointerToRawData value of a debug structure. If an invalid structure is specified
277 * by the parameter uiIndex the result will be undefined behaviour. 277 * by the parameter uiIndex the result will be undefined behaviour.
278 * @param uiIndex Identifies the debug structure. 278 * @param uiIndex Identifies the debug structure.
279 * @return PointerToRawData value of the debug structure. 279 * @return PointerToRawData value of the debug structure.
280 **/ 280 **/
281 dword DebugDirectory::getPointerToRawData(unsigned int uiIndex) const 281 dword DebugDirectory::getPointerToRawData(unsigned int uiIndex) const
282 { 282 {
283 return m_vDebugInfo[uiIndex].idd.PointerToRawData; 283 return m_vDebugInfo[uiIndex].idd.PointerToRawData;
284 } 284 }
285 285
286 std::vector<byte> DebugDirectory::getData(unsigned int index) const 286 std::vector<byte> DebugDirectory::getData(unsigned int index) const
287 { 287 {
288 return m_vDebugInfo[index].data; 288 return m_vDebugInfo[index].data;
289 } 289 }
290 290
291 /** 291 /**
292 * Changes the Characteristics value of a debug structure. If an invalid structure is specified 292 * Changes the Characteristics value of a debug structure. If an invalid structure is specified
293 * by the parameter uiIndex the result will be undefined behaviour. 293 * by the parameter uiIndex the result will be undefined behaviour.
294 * @param uiIndex Identifies the debug structure. 294 * @param uiIndex Identifies the debug structure.
295 * @param dwValue New value of the Characteristics value of the debug structure. 295 * @param dwValue New value of the Characteristics value of the debug structure.
296 **/ 296 **/
297 void DebugDirectory::setCharacteristics(unsigned int uiIndex, dword dwValue) 297 void DebugDirectory::setCharacteristics(unsigned int uiIndex, dword dwValue)
298 { 298 {
299 m_vDebugInfo[uiIndex].idd.Characteristics = dwValue; 299 m_vDebugInfo[uiIndex].idd.Characteristics = dwValue;
300 } 300 }
301 301
302 /** 302 /**
303 * Changes the TimeDateStamp value of a debug structure. If an invalid structure is specified 303 * Changes the TimeDateStamp value of a debug structure. If an invalid structure is specified
304 * by the parameter uiIndex the result will be undefined behaviour. 304 * by the parameter uiIndex the result will be undefined behaviour.
305 * @param uiIndex Identifies the debug structure. 305 * @param uiIndex Identifies the debug structure.
306 * @param dwValue New value of the TimeDateStamp value of the debug structure. 306 * @param dwValue New value of the TimeDateStamp value of the debug structure.
307 **/ 307 **/
308 void DebugDirectory::setTimeDateStamp(unsigned int uiIndex, dword dwValue) 308 void DebugDirectory::setTimeDateStamp(unsigned int uiIndex, dword dwValue)
309 { 309 {
310 m_vDebugInfo[uiIndex].idd.TimeDateStamp = dwValue; 310 m_vDebugInfo[uiIndex].idd.TimeDateStamp = dwValue;
311 } 311 }
312 312
313 /** 313 /**
314 * Changes the MajorVersion value of a debug structure. If an invalid structure is specified 314 * Changes the MajorVersion value of a debug structure. If an invalid structure is specified
315 * by the parameter uiIndex the result will be undefined behaviour. 315 * by the parameter uiIndex the result will be undefined behaviour.
316 * @param uiIndex Identifies the debug structure. 316 * @param uiIndex Identifies the debug structure.
317 * @param wValue New value of the MajorVersion value of the debug structure. 317 * @param wValue New value of the MajorVersion value of the debug structure.
318 **/ 318 **/
319 void DebugDirectory::setMajorVersion(unsigned int uiIndex, word wValue) 319 void DebugDirectory::setMajorVersion(unsigned int uiIndex, word wValue)
320 { 320 {
321 m_vDebugInfo[uiIndex].idd.MajorVersion = wValue; 321 m_vDebugInfo[uiIndex].idd.MajorVersion = wValue;
322 } 322 }
323 323
324 /** 324 /**
325 * Changes the MinorVersion value of a debug structure. If an invalid structure is specified 325 * Changes the MinorVersion value of a debug structure. If an invalid structure is specified
326 * by the parameter uiIndex the result will be undefined behaviour. 326 * by the parameter uiIndex the result will be undefined behaviour.
327 * @param uiIndex Identifies the debug structure. 327 * @param uiIndex Identifies the debug structure.
328 * @param wValue New value of the MinorVersion value of the debug structure. 328 * @param wValue New value of the MinorVersion value of the debug structure.
329 **/ 329 **/
330 void DebugDirectory::setMinorVersion(unsigned int uiIndex, word wValue) 330 void DebugDirectory::setMinorVersion(unsigned int uiIndex, word wValue)
331 { 331 {
332 m_vDebugInfo[uiIndex].idd.MinorVersion = wValue; 332 m_vDebugInfo[uiIndex].idd.MinorVersion = wValue;
333 } 333 }
334 334
335 /** 335 /**
336 * Changes the Type value of a debug structure. If an invalid structure is specified 336 * Changes the Type value of a debug structure. If an invalid structure is specified
337 * by the parameter uiIndex the result will be undefined behaviour. 337 * by the parameter uiIndex the result will be undefined behaviour.
338 * @param uiIndex Identifies the debug structure. 338 * @param uiIndex Identifies the debug structure.
339 * @param dwValue New value of the Type value of the debug structure. 339 * @param dwValue New value of the Type value of the debug structure.
340 **/ 340 **/
341 void DebugDirectory::setType(unsigned int uiIndex, dword dwValue) 341 void DebugDirectory::setType(unsigned int uiIndex, dword dwValue)
342 { 342 {
343 m_vDebugInfo[uiIndex].idd.Type = dwValue; 343 m_vDebugInfo[uiIndex].idd.Type = dwValue;
344 } 344 }
345 345
346 /** 346 /**
347 * Changes the SizeOfData value of a debug structure. If an invalid structure is specified 347 * Changes the SizeOfData value of a debug structure. If an invalid structure is specified
348 * by the parameter uiIndex the result will be undefined behaviour. 348 * by the parameter uiIndex the result will be undefined behaviour.
349 * @param uiIndex Identifies the debug structure. 349 * @param uiIndex Identifies the debug structure.
350 * @param dwValue New value of the SizeOfData value of the debug structure. 350 * @param dwValue New value of the SizeOfData value of the debug structure.
351 **/ 351 **/
352 void DebugDirectory::setSizeOfData(unsigned int uiIndex, dword dwValue) 352 void DebugDirectory::setSizeOfData(unsigned int uiIndex, dword dwValue)
353 { 353 {
354 m_vDebugInfo[uiIndex].idd.SizeOfData = dwValue; 354 m_vDebugInfo[uiIndex].idd.SizeOfData = dwValue;
355 } 355 }
356 356
357 /** 357 /**
358 * Changes the AddressOfRawData value of a debug structure. If an invalid structure is specified 358 * Changes the AddressOfRawData value of a debug structure. If an invalid structure is specified
359 * by the parameter uiIndex the result will be undefined behaviour. 359 * by the parameter uiIndex the result will be undefined behaviour.
360 * @param uiIndex Identifies the debug structure. 360 * @param uiIndex Identifies the debug structure.
361 * @param dwValue New value of the AddressOfRawData value of the debug structure. 361 * @param dwValue New value of the AddressOfRawData value of the debug structure.
362 **/ 362 **/
363 void DebugDirectory::setAddressOfRawData(unsigned int uiIndex, dword dwValue) 363 void DebugDirectory::setAddressOfRawData(unsigned int uiIndex, dword dwValue)
364 { 364 {
365 m_vDebugInfo[uiIndex].idd.AddressOfRawData = dwValue; 365 m_vDebugInfo[uiIndex].idd.AddressOfRawData = dwValue;
366 } 366 }
367 367
368 /** 368 /**
369 * Changes the PointerToRawData value of a debug structure. If an invalid structure is specified 369 * Changes the PointerToRawData value of a debug structure. If an invalid structure is specified
370 * by the parameter uiIndex the result will be undefined behaviour. 370 * by the parameter uiIndex the result will be undefined behaviour.
371 * @param uiIndex Identifies the debug structure. 371 * @param uiIndex Identifies the debug structure.
372 * @param dwValue New value of the PointerToRawData value of the debug structure. 372 * @param dwValue New value of the PointerToRawData value of the debug structure.
373 **/ 373 **/
374 void DebugDirectory::setPointerToRawData(unsigned int uiIndex, dword dwValue) 374 void DebugDirectory::setPointerToRawData(unsigned int uiIndex, dword dwValue)
375 { 375 {
376 m_vDebugInfo[uiIndex].idd.PointerToRawData = dwValue; 376 m_vDebugInfo[uiIndex].idd.PointerToRawData = dwValue;
377 } 377 }
378 378
379 void DebugDirectory::setData(unsigned int index, const std::vector<byte>& data) 379 void DebugDirectory::setData(unsigned int index, const std::vector<byte>& data)
380 { 380 {
381 m_vDebugInfo[index].data = data; 381 m_vDebugInfo[index].data = data;
382 } 382 }
383} 383}