Skip to content

Commit

Permalink
Fix a regression with header rebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
0cyn committed Nov 10, 2023
1 parent 6a98d4d commit aaf144c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ktool/macho.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def insert_load_command(self, load_command, index=-1, suffix=None):
for i in range(command.nsects):
sects.append(Section(None, Struct.create_with_bytes(struct_class, sect_data[i * struct_class.SIZE:(
i + 1) * struct_class.SIZE],
"little")))
"little"), 8 if self.is64 else 4))
seg = SegmentLoadCommand.from_values(isinstance(command, segment_command_64), command.segname,
command.vmaddr, command.vmsize, command.fileoff, command.filesize,
command.maxprot, command.initprot, command.flags, sects)
Expand Down Expand Up @@ -640,7 +640,7 @@ def remove_load_command(self, index):
for i in range(command.nsects):
sects.append(Section(None, Struct.create_with_bytes(struct_class, sect_data[i * struct_class.SIZE:(
i + 1) * struct_class.SIZE],
"little")))
"little"), 8 if self.is64 else 4))
seg = SegmentLoadCommand.from_values(isinstance(command, segment_command_64), command.segname,
command.vmaddr, command.vmsize, command.fileoff, command.filesize,
command.maxprot, command.initprot, command.flags, sects)
Expand Down Expand Up @@ -708,7 +708,7 @@ def replace_load_command(self, load_command, index=-1, suffix=None):
for i in range(command.nsects):
sects.append(Section(None, Struct.create_with_bytes(struct_class, sect_data[i * struct_class.SIZE:(
i + 1) * struct_class.SIZE],
"little")))
"little"), 8 if self.is64 else 4))
seg = SegmentLoadCommand.from_values(isinstance(command, segment_command_64), command.segname,
command.vmaddr, command.vmsize, command.fileoff, command.filesize,
command.maxprot, command.initprot, command.flags, sects)
Expand Down

0 comments on commit aaf144c

Please sign in to comment.