Skip to content
Open
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v18.1.8'
rev: 'v22.1.5'
hooks:
- id: clang-format
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.1
rev: v0.15.15
hooks:
# Run the linter.
- id: ruff
Expand Down
25 changes: 10 additions & 15 deletions scripts/pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4036,7 +4036,7 @@ def parse_directory_tls(self, rva, size):
)
except PEFormatError:
self.__warnings.append(
"Invalid TLS information. Can't read " "data at RVA: 0x%x" % rva
"Invalid TLS information. Can't read data at RVA: 0x%x" % rva
)
tls_struct = None

Expand Down Expand Up @@ -4081,7 +4081,7 @@ def parse_directory_load_config(self, rva, size):
)
except PEFormatError:
self.__warnings.append(
"Invalid LOAD_CONFIG information. Can't read " "data at RVA: 0x%x" % rva
"Invalid LOAD_CONFIG information. Can't read data at RVA: 0x%x" % rva
)

if not load_config_struct:
Expand Down Expand Up @@ -4155,8 +4155,7 @@ def parse_dynamic_relocations(
)
except PEFormatError:
self.__warnings.append(
"Invalid relocation information. Can't read "
"data at RVA: 0x%x" % rva
"Invalid relocation information. Can't read data at RVA: 0x%x" % rva
)
dynamic_rlc = None

Expand Down Expand Up @@ -4213,8 +4212,7 @@ def parse_function_override_data(self, rva):
)
if not func_header:
self.__warnings.append(
"Invalid function override header. Can't read "
"data at RVA: 0x%x" % rva
"Invalid function override header. Can't read data at RVA: 0x%x" % rva
)
return func_relocs, bdd_relocs
rva += Structure(format).sizeof()
Expand All @@ -4230,8 +4228,7 @@ def parse_function_override_data(self, rva):
)
if not func_info:
self.__warnings.append(
"Invalid function override info. Can't read "
"data at RVA: 0x%x" % rva
"Invalid function override info. Can't read data at RVA: 0x%x" % rva
)
return func_relocs, bdd_relocs
rva += Structure(format).sizeof()
Expand Down Expand Up @@ -4263,7 +4260,7 @@ def parse_function_override_data(self, rva):
)
if not bdd_info:
self.__warnings.append(
"Invalid bdd info. Can't read " "data at RVA: 0x%x" % rva
"Invalid bdd info. Can't read data at RVA: 0x%x" % rva
)
return func_relocs, bdd_relocs
rva += Structure(format).sizeof()
Expand All @@ -4277,8 +4274,7 @@ def parse_function_override_data(self, rva):
)
if not bdd_reloc:
self.__warnings.append(
"Invalid bdd dynamic relocation. Can't read "
"data at RVA: 0x%x" % rva
"Invalid bdd dynamic relocation. Can't read data at RVA: 0x%x" % rva
)
return func_relocs, bdd_relocs
rva += Structure(format).sizeof()
Expand Down Expand Up @@ -4309,8 +4305,7 @@ def parse_image_base_relocation_list(self, rva, size, fmt=None):
)
except PEFormatError:
self.__warnings.append(
"Invalid relocation information. Can't read "
"data at RVA: 0x%x" % rva
"Invalid relocation information. Can't read data at RVA: 0x%x" % rva
)
rlc = None

Expand Down Expand Up @@ -4444,7 +4439,7 @@ def parse_debug_directory(self, rva, size):
data = self.get_data(rva + dbg_size * idx, dbg_size)
except PEFormatError:
self.__warnings.append(
"Invalid debug information. Can't read " "data at RVA: 0x%x" % rva
"Invalid debug information. Can't read data at RVA: 0x%x" % rva
)
return None

Expand Down Expand Up @@ -6220,7 +6215,7 @@ def get_import_table(self, rva, max_length=None, contains_addresses=False):

if failed or len(data) != expected_size:
self.__warnings.append(
"Error parsing the import table. " "Invalid data at RVA: 0x%x" % rva
"Error parsing the import table. Invalid data at RVA: 0x%x" % rva
)
return None

Expand Down
Loading