Skip to content

Invalid PC value on ARM, EABI5 version 1 (SYSV) #137

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

Open
mrsteyk opened this issue May 13, 2021 · 0 comments
Open

Invalid PC value on ARM, EABI5 version 1 (SYSV) #137

mrsteyk opened this issue May 13, 2021 · 0 comments

Comments

@mrsteyk
Copy link

mrsteyk commented May 13, 2021

Describe the bug
It appears that PC register on 32 bit ARM has an invalid value, resulting in invalid PC-relative resolution.

To Reproduce
Steps to reproduce the behavior:

  1. Download this
  2. Type py -3 -m zelos ./libzlib.so
  3. See an error message
  4. Open this place in IDA and see correct address resolution (0x15FD8 instead of 0x15FD0)

Expected behavior
Correct PC value should not point at the exact address like IP on x86

Screenshots
Not applicable

Additional context
According to the ARM IC.

In ARM state, the value of the PC is the address of the current instruction plus 8 bytes.
In Thumb state:

  • For B, BL, CBNZ, and CBZ instructions, the value of the PC is the address of the current instruction plus 4 bytes.
  • For all other instructions that use labels, the value of the PC is the address of the current instruction plus 4 bytes, with bit[1] of the result cleared to 0 to make it word-aligned.
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

1 participant