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

Increase readability and consistency #412

Merged
merged 2 commits into from
Aug 26, 2024
Merged
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
15 changes: 7 additions & 8 deletions pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,6 @@ def parse_strings(data, counter, l):
l[counter] = data[i : i + len_ * 2].decode("utf-16le")
except UnicodeDecodeError:
error_count += 1
pass
if error_count >= 3:
break
i += len_ * 2
Expand Down Expand Up @@ -1129,10 +1128,10 @@ def dump_dict(self):
class SectionStructure(Structure):
"""Convenience section handling class."""

def __init__(self, *argl, **argd):
if "pe" in argd:
self.pe = argd["pe"]
del argd["pe"]
def __init__(self, *args, **kwargs):
if "pe" in kwargs:
self.pe = kwargs["pe"]
del kwargs["pe"]

self.PointerToRawData = None
self.VirtualAddress = None
Expand Down Expand Up @@ -1523,9 +1522,9 @@ def _pack_bitfield_attributes(self):
class DataContainer:
"""Generic data container."""

def __init__(self, **args):
def __init__(self, **kwargs):
bare_setattr = super().__setattr__
for key, value in args.items():
for key, value in kwargs.items():
bare_setattr(key, value)


Expand Down Expand Up @@ -5618,7 +5617,7 @@ def normalize_import_va(self, va):

# Try to avoid bogus VAs, which are out of the image.
# This also filters out entries that are zero
if begin_of_image <= va and va < end_of_image:
if begin_of_image <= va < end_of_image:
va -= begin_of_image
return va

Expand Down
Loading