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

Add pyelftools stubs #11262

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JonathonReinhart
Copy link

@JonathonReinhart JonathonReinhart commented Jan 8, 2024

Copy link
Contributor

github-actions bot commented Jan 8, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

manticore (https://github.com/trailofbits/manticore)
+ manticore/platforms/linux.py:1461: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1498: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1532: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1563: error: "Struct" has no attribute "e_entry"  [attr-defined]
+ manticore/platforms/linux.py:1564: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1595: error: "Struct" has no attribute "e_entry"  [attr-defined]
+ manticore/platforms/linux.py:1613: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1647: error: "Struct" has no attribute "e_type"  [attr-defined]
+ manticore/platforms/linux.py:1682: error: "Struct" has no attribute "e_phoff"  [attr-defined]
+ manticore/platforms/linux.py:1683: error: "Struct" has no attribute "e_phentsize"  [attr-defined]
+ manticore/platforms/linux.py:1684: error: "Struct" has no attribute "e_phnum"  [attr-defined]
+ manticore/platforms/linux.py:1687: error: "Struct" has no attribute "e_flags"  [attr-defined]

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/commands/elf.py:3: note: In module imported here:
+ pwndbg/gdblib/elf.py: note: In function "get_elf_info":
+ pwndbg/gdblib/elf.py:103: error: No overload variant of "dict" matches argument type "Struct"  [call-overload]
+ pwndbg/gdblib/elf.py:103: note: Possible overload variants:
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[_KT, _VT], /) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[tuple[_KT, _VT]], /) -> dict[_KT, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> dict[str, _VT]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[list[str]], /) -> dict[str, str]
+ pwndbg/gdblib/elf.py:103: note:     def [_KT, _VT] __init__(self, Iterable[list[bytes]], /) -> dict[bytes, bytes]

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

Successfully merging this pull request may close these issues.

None yet

1 participant