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

Python bindings report invalid build SDK #533

Closed
blochberger opened this issue Jan 22, 2021 · 2 comments
Closed

Python bindings report invalid build SDK #533

blochberger opened this issue Jan 22, 2021 · 2 comments

Comments

@blochberger
Copy link

.def_property("sdk",
static_cast<getter_t<BuildVersion::version_t>>(&BuildVersion::minos),
static_cast<setter_t<BuildVersion::version_t>>(&BuildVersion::minos),
"SDK Version")

The returned property is BuildVersion::minos but instead BuildVersion::sdk should be returned. This is presumably a copy and paste error.

@blochberger
Copy link
Author

Here is a simple temporary workaround for anyone who depends on the actual build SDK version:

import lief
import re

from typing import Tuple

def build_version_sdk(binary: lief.MachO.Binary) -> Tuple[int, int, int]:
    rx = re.compile(r'SDK: (\d+)\.(\d+)\.(\d+)')
    m = rx.search(str(binary.build_version))
    return tuple(map(int, m.groups()))

@romainthomas
Copy link
Member

Thanks!

Clcanny pushed a commit to Clcanny/LIEF that referenced this issue Feb 8, 2021
xhochy pushed a commit to xhochy/LIEF that referenced this issue May 25, 2021
romainthomas added a commit that referenced this issue Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants