Skip to content

Commit

Permalink
Some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed Jun 3, 2022
1 parent e9bf2a2 commit efbd061
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions peclasses/pe_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ImageOptionalHeader(AnnotatedStructure):
size_of_heap_commit: c_uint
loader_flags: c_uint
number_of_rva_and_sizes: c_uint
image_data_directory: ImageDataDirectoryArray
data_directory: ImageDataDirectoryArray


class ImageNTHeaders(AnnotatedStructure):
Expand Down Expand Up @@ -136,7 +136,7 @@ class ImageOptionalHeader64(AnnotatedStructure):
size_of_heap_commit: c_ulonglong
loader_flags: c_uint
number_of_rva_and_sizes: c_uint
image_data_directory: ImageDataDirectoryArray
data_directory: ImageDataDirectoryArray


class ImageNTHeaders64(AnnotatedStructure):
Expand Down
6 changes: 3 additions & 3 deletions peclasses/portable_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _read_file(self, file):

self.file_header = self.nt_headers.file_header
self.optional_header = self.nt_headers.optional_header
self.data_directory = self.optional_header.image_data_directory
self.data_directory = self.optional_header.data_directory
self._section_table = None
self._relocation_table = None

Expand All @@ -58,7 +58,7 @@ def reread(self):
def optional_header_offset(self) -> Offset:
return self.dos_header.e_lfanew + 4 + sizeof(ImageFileHeader)

def rewrite_image_nt_headers(self):
def rewrite_nt_headers(self):
offset = self.dos_header.e_lfanew
nt_headers_data = bytes(self.nt_headers)[:self.nt_headers_size]
self.file.seek(offset)
Expand Down Expand Up @@ -132,7 +132,7 @@ def add_new_section(self, new_section: Section, data_size: int):
new_section.virtual_address + new_section.virtual_size,
section_alignment
)
self.rewrite_image_nt_headers()
self.rewrite_nt_headers()

def info(self):
entry_point = (self.optional_header.address_of_entry_point
Expand Down

0 comments on commit efbd061

Please sign in to comment.