1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 """
32 Exceptions used by the entire library.
33
34 @group Base exceptions:
35 PyPe32Exception, PyPe32Warning
36
37 @group Warnings:
38 PEWarning
39
40 @group Exceptions:
41 PEException,NotValidPathException,WrongOffsetValueException,DirectoryEntriesLengthException,
42 TypeNotSupportedException,ArrayTypeException,DataLengthException,ReadDataOffsetException,
43 WriteDataOffsetException,InstanceErrorException,DataMismatchException,SectionHeadersException,
44 DirectoryEntryException,InvalidParameterException
45 """
46
47 __revision__ = "$Id$"
48
49 __all__ = [
50 "PyPe32Exception",
51 "PyPe32Warning",
52 "PEWarning",
53 "PEException",
54 "NotValidPathException",
55 "WrongOffsetValueException",
56 "DirectoryEntriesLengthException",
57 "TypeNotSupportedException",
58 "ArrayTypeException",
59 "DataLengthException",
60 "ReadDataOffsetException",
61 "WriteDataOffsetException",
62 "InstanceErrorException",
63 "DataMismatchException",
64 "SectionHeadersException",
65 "DirectoryEntryException",
66 "InvalidParameterException",
67 ]
68
70 """Base exception class."""
71 pass
72
74 """Base warning class."""
75 pass
76
78 """Raised when a suspicious value is found into the PE instance."""
79 pass
80
82 """Raised when an invalid field on the PE instance was found."""
83 pass
84
86 """Raised when a path wasn't found or it is an invalid path."""
87 pass
88
90 """
91 Used primary by the L{ReadData} and L{WriteData} object in read/write operations when an invalid
92 offset value was used.
93 """
94 pass
95
97 """Raised when the the number of entries in a L{DataDirectory} object is different from L{consts.IMAGE_NUMBEROF_DIRECTORY_ENTRIES}."""
98 pass
99
101 """This exception must be used when an invalid data type is used within the library."""
102 pass
103
105 """Raised when creating an unsupported type of array."""
106 pass
107
109 """Raised when data lengths does not match."""
110 pass
111
113 """This exception must be raised when reading from an invalid offset."""
114 pass
115
117 """This exception must be raised when writing to an invalid offset."""
118 pass
119
121 """This exception is raised when an instance parameter was not specified."""
122 pass
123
125 """Raised when two different types of data does not match."""
126 pass
127
129 """Raised when an error related to a L{pype32.SectionHeader} or L{pype32.SectionHeaders} is found."""
130 pass
131
132 -class DirectoryEntryException(PyPe32Exception):
133 """This exception must be raised when an error with the L{Directory} is found."""
134 pass
135
137 """Raised when an invalid parameter is received."""
138 pass
139