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

Fix ptrsize for ARM to not return 2 ever #876

Merged
merged 1 commit into from Jul 10, 2022
Merged

Fix ptrsize for ARM to not return 2 ever #876

merged 1 commit into from Jul 10, 2022

Conversation

lain3d
Copy link
Contributor

@lain3d lain3d commented Jul 8, 2022

Description/Motivation/Screenshots

This changes the ptrsize on ARM to properly reflect that ptrsize will always be 4 even in thumb mode. This allows the stack and tele to both increment by 4 instead of 2, properly allowing gef to dereference pointers.

Relevant code:

    @property
    def instruction_length(self) -> Optional[int]:
        # Thumb instructions have variable-length (2 or 4-byte)
        return None if self.is_thumb() else 4

    @property
    def ptrsize(self) -> int:
        return 4

Against which architecture was this tested ?

"Tested" indicates that the PR works and the unit test (i.e. make test) run passes without issue.

  • x86-32
  • x86-64
  • ARM
  • AARCH64
  • MIPS
  • POWERPC
  • SPARC
  • RISC-V

Checklist

  • My PR was done against the dev branch, not main.
  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • If my change adds new code, adequate tests have been added.
  • I have read and agree to the CONTRIBUTING document.

@hugsy hugsy added this to the Release: next milestone Jul 8, 2022
@hugsy hugsy added the bug label Jul 8, 2022
@hugsy hugsy merged commit 01da142 into hugsy:dev Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants