def get_peinfo(
        filepath: str, save_to_json_path: str | None = None
    ) -> tuple[list[int], list[int]]:  # pragma: no cover
        """
        Given a PE file we extract out the section information to determine the slack regions in the file.
        We return two lists 1) with the start location of the slack regions and 2) with the size of the slack region.
        We are using the lief library (https://github.com/lief-project/LIEF) to manipulate the PE file.

        :param filepath: Path to file we want to analyse with pedump and get the section information.
        :param save_to_json_path: (Optional) if we want to save the results of pedump to a json file, provide the path.
        :return start_of_slack: A list with the slack starts
        :return size_of_slack: A list with the slack start positions
        """
        import lief  # pylint: disable=import-outside-toplevel

        start_of_slack = []
        size_of_slack = []

        cleaned_dump = {}

        binary_load = lief.parse(filepath)
        if binary_load is not None:
            binary = binary_load
        else:
            raise ValueError("Failed to load binary.")

        for section in binary.sections:
            section_info = {}
            slack = section.sizeof_raw_data - section.virtual_size  # type: ignore
            section_info["PointerToRawData"] = section.pointerto_raw_data  # type: ignore
            section_info["VirtualAddress"] = section.virtual_size  # type: ignore
            section_info["SizeOfRawData"] = section.sizeof_raw_data  # type: ignore
            cleaned_dump[section.name] = section_info
            if slack > 0:
                size_of_slack.append(slack)
                start_of_slack.append(section.pointerto_raw_data + section.virtual_size)  # type: ignore

        if save_to_json_path is not None:
            with open(save_to_json_path, "w", encoding="utf8") as outfile:
                json.dump(cleaned_dump, outfile, indent=4, sort_keys=True)

        return start_of_slack, size_of_slack

        Given a PE file we extract out the section information to determine the slack regions in the file.
        We return two lists 1) with the start location of the slack regions and 2) with the size of the slack region.
        We are using the lief library (https://github.com/lief-project/LIEF) to manipulate the PE file.

        :param filepath: Path to file we want to analyse with pedump and get the section information.
        :param save_to_json_path: (Optional) if we want to save the results of pedump to a json file, provide the path.
        :return start_of_slack: A list with the slack starts
        :return size_of_slack: A list with the slack start positions
        
art/attacks/evasion/pe_malware_attack.py