diff options
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp')
-rw-r--r--[-rwxr-xr-x] | utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp b/utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp index fe7011072c..1199e6bdd1 100755..100644 --- a/utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp +++ b/utils/zenutils/libraries/pelib-0.9/pelib/PeHeader.cpp | |||
@@ -1,90 +1,90 @@ | |||
1 | /* | 1 | /* |
2 | * PeHeader.cpp - Part of the PeLib library. | 2 | * PeHeader.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 "PeHeader.h" | 14 | #include "PeHeader.h" |
15 | 15 | ||
16 | namespace PeLib | 16 | namespace PeLib |
17 | { | 17 | { |
18 | template<> | 18 | template<> |
19 | void PeHeaderT<32>::readBaseOfData(InputBuffer& ibBuffer, PELIB_IMAGE_NT_HEADERS<32>& header) const | 19 | void PeHeaderT<32>::readBaseOfData(InputBuffer& ibBuffer, PELIB_IMAGE_NT_HEADERS<32>& header) const |
20 | { | 20 | { |
21 | ibBuffer >> header.OptionalHeader.BaseOfData; | 21 | ibBuffer >> header.OptionalHeader.BaseOfData; |
22 | } | 22 | } |
23 | 23 | ||
24 | template<> | 24 | template<> |
25 | void PeHeaderT<64>::readBaseOfData(InputBuffer&, PELIB_IMAGE_NT_HEADERS<64>&) const | 25 | void PeHeaderT<64>::readBaseOfData(InputBuffer&, PELIB_IMAGE_NT_HEADERS<64>&) const |
26 | { | 26 | { |
27 | } | 27 | } |
28 | 28 | ||
29 | template<> | 29 | template<> |
30 | void PeHeaderT<32>::rebuildBaseOfData(OutputBuffer& obBuffer) const | 30 | void PeHeaderT<32>::rebuildBaseOfData(OutputBuffer& obBuffer) const |
31 | { | 31 | { |
32 | obBuffer << m_inthHeader.OptionalHeader.BaseOfData; | 32 | obBuffer << m_inthHeader.OptionalHeader.BaseOfData; |
33 | } | 33 | } |
34 | 34 | ||
35 | template<> | 35 | template<> |
36 | void PeHeaderT<64>::rebuildBaseOfData(OutputBuffer&) const | 36 | void PeHeaderT<64>::rebuildBaseOfData(OutputBuffer&) const |
37 | { | 37 | { |
38 | } | 38 | } |
39 | 39 | ||
40 | template<> | 40 | template<> |
41 | bool PeHeaderT<32>::isValid() const | 41 | bool PeHeaderT<32>::isValid() const |
42 | { | 42 | { |
43 | return true; | 43 | return true; |
44 | } | 44 | } |
45 | 45 | ||
46 | template<> | 46 | template<> |
47 | bool PeHeaderT<64>::isValid() const | 47 | bool PeHeaderT<64>::isValid() const |
48 | { | 48 | { |
49 | return true; | 49 | return true; |
50 | } | 50 | } |
51 | 51 | ||
52 | template<> | 52 | template<> |
53 | bool PeHeaderT<32>::isValid(unsigned int pehf) const | 53 | bool PeHeaderT<32>::isValid(unsigned int pehf) const |
54 | { | 54 | { |
55 | /* | 55 | /* |
56 | if (pehf == NtSignature) | 56 | if (pehf == NtSignature) |
57 | { | 57 | { |
58 | return m_inthHeader.Signature == IMAGE_NT_SIGNATURE; | 58 | return m_inthHeader.Signature == IMAGE_NT_SIGNATURE; |
59 | } | 59 | } |
60 | else if (pehf == NumberOfSections) | 60 | else if (pehf == NumberOfSections) |
61 | { | 61 | { |
62 | return getNumberOfSections() == calcNumberOfSections(); | 62 | return getNumberOfSections() == calcNumberOfSections(); |
63 | } */ | 63 | } */ |
64 | return false; | 64 | return false; |
65 | } | 65 | } |
66 | 66 | ||
67 | template<> | 67 | template<> |
68 | bool PeHeaderT<64>::isValid(unsigned int pehf) const | 68 | bool PeHeaderT<64>::isValid(unsigned int pehf) const |
69 | { | 69 | { |
70 | return false; | 70 | return false; |
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * @return The BaseOfData value from the PE header. | 74 | * @return The BaseOfData value from the PE header. |
75 | **/ | 75 | **/ |
76 | dword PeHeader32::getBaseOfData() const | 76 | dword PeHeader32::getBaseOfData() const |
77 | { | 77 | { |
78 | return m_inthHeader.OptionalHeader.BaseOfData; | 78 | return m_inthHeader.OptionalHeader.BaseOfData; |
79 | } | 79 | } |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Changes the file's BaseOfData. | 82 | * Changes the file's BaseOfData. |
83 | * @param dwValue New value. | 83 | * @param dwValue New value. |
84 | **/ | 84 | **/ |
85 | void PeHeader32::setBaseOfData(dword dwValue) | 85 | void PeHeader32::setBaseOfData(dword dwValue) |
86 | { | 86 | { |
87 | m_inthHeader.OptionalHeader.BaseOfData = dwValue; | 87 | m_inthHeader.OptionalHeader.BaseOfData = dwValue; |
88 | } | 88 | } |
89 | 89 | ||
90 | } | 90 | } |