Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change IOError to OSError #401

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3120,7 +3120,7 @@ def __parse__(self, fname, data, fast_load):
if not self.FILE_HEADER:
raise PEFormatError("File Header missing")

# Set the image's flags according the the Characteristics member
# Set the image's flags according to the Characteristics member
set_flags(self.FILE_HEADER, self.FILE_HEADER.Characteristics, image_flags)

optional_header_offset = nt_headers_offset + 4 + self.FILE_HEADER.sizeof()
Expand Down Expand Up @@ -3232,7 +3232,7 @@ def __parse__(self, fname, data, fast_load):
DLL_CHARACTERISTICS, "IMAGE_DLLCHARACTERISTICS_"
)

# Set the Dll Characteristics flags according the the DllCharacteristics member
# Set the Dll Characteristics flags according to the DllCharacteristics member
set_flags(
self.OPTIONAL_HEADER,
self.OPTIONAL_HEADER.DllCharacteristics,
Expand Down Expand Up @@ -3640,7 +3640,7 @@ def parse_sections(self, offset):

section_flags = retrieve_flags(SECTION_CHARACTERISTICS, "IMAGE_SCN_")

# Set the section's flags according the the Characteristics member
# Set the section's flags according to the Characteristics member
set_flags(section, section.Characteristics, section_flags)

if section.__dict__.get(
Expand Down Expand Up @@ -5458,7 +5458,7 @@ def length_until_eof(rva):

# If the function's RVA points within the export directory
# it will point to a string with the forwarded symbol's string
# instead of pointing the the function start address.
# instead of pointing to the function start address.
if symbol_address >= rva and symbol_address < rva + size:
forwarder_str = self.get_string_at_rva(symbol_address)
try:
Expand Down Expand Up @@ -6304,7 +6304,7 @@ def get_memory_mapped_image(self, max_virtual_address=0x10000000, ImageBase=None
return mapped_data

def get_resources_strings(self):
"""Returns a list of all the strings found withing the resources (if any).
"""Returns a list of all the strings found within the resources (if any).

This method will scan all entries in the resources directory of the PE, if
there is one, and will return a [] with the strings.
Expand Down
6 changes: 3 additions & 3 deletions peutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
__contact__ = "ero.carrera@gmail.com"


class SignatureDatabase(object):
class SignatureDatabase:
"""This class loads and keeps a parsed PEiD signature database.

Usage:
Expand Down Expand Up @@ -397,7 +397,7 @@ def __load(self, filename=None, data=None):
sig_f = urllib.request.urlopen(filename)
sig_data = sig_f.read()
sig_f.close()
except IOError:
except OSError:
# Let this be raised back to the user...
raise
else:
Expand All @@ -407,7 +407,7 @@ def __load(self, filename=None, data=None):
sig_f = open(filename, "rt")
sig_data = sig_f.read()
sig_f.close()
except IOError:
except OSError:
# Let this be raised back to the user...
raise
else:
Expand Down
Loading