Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: implement full back-to-front scan for embedded archive #5511

Merged
merged 1 commit into from Feb 27, 2021

Commits on Feb 23, 2021

  1. bootloader: archive: implement full back-to-front scan for archive co…

    …okie
    
    Implement full back-to-front file scan for finding the embedded
    archive's cookie. This saves us from having to make assumptions
    about the cookie's positon, which both simplifies the search and
    makes it more robust.
    
    Currently, we are searching within fixed-sized search window either
    from the end of file or from end of file's digital signature (if
    present; on Windows and macOS only).
    
    This breaks when a 3rd party tool appends extra data at the end
    of executable; for example, with PIE bootloader executable,
    staticx tool on linux will append extra sections at the end of file,
    which is perfectly valid behavior, but it breaks our fixed-size
    search window assumptions. Therefore, full back-to-front search
    fixes pyinstaller#5330.
    
    Another motivation for brute-force search is macOS 11, as we will
    sooner or later want to support universal2 fat binary bootloaders
    in addition to single-arch thin ones. Full-file search allows
    us to do so without having to search for digital signature and
    in turn parsing the headers of each binary format.
    rokm committed Feb 23, 2021
    Configuration menu
    Copy the full SHA
    f09400a View commit details
    Browse the repository at this point in the history