Skip to content

LC_BUILD_VERSION not parsed and cause the parse to fail #25

@KasperskyZiv

Description

@KasperskyZiv

you can try to parse sha256 "f05d79dd0e21acc96377e38617bfe070bf8e4c430dc9552808cfbff9841d6427"

the fix i think will work best is update parse_lcs with:

        for lc_num in range(nlcs):
            # Add this:
            prev = self._file.tell()
            cmd = self.get_int()       # Load command type
            cmd_size = self.get_int()  # Size of load command
            ...
            ...
            ...
            elif cmd == 'MAIN':
                self.__macho['lcs'].append(self.parse_main(cmd, cmd_size))
            # and this
            elif cmd == "BUILD_VERSION":
                self.__macho['lcs'].append(self.parse_version_min_os(cmd, cmd_size))
                self._file.seek(prev + cmd_size)
            else:
                logger.warning(f"Failed to parse lc {cmd}, skipping it")
                self._file.seek(prev + cmd_size)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions