Skip to content

Fix incorrect RIP-relative detection logic and mmap() parameter order#109

Merged
GJDuck merged 2 commits intoGJDuck:masterfrom
ehgus607:master
Mar 3, 2026
Merged

Fix incorrect RIP-relative detection logic and mmap() parameter order#109
GJDuck merged 2 commits intoGJDuck:masterfrom
ehgus607:master

Conversation

@ehgus607
Copy link
Contributor

@ehgus607 ehgus607 commented Mar 2, 2026

d03f658: The code is checking for RIP-relative addressing (mod==0x00 AND rm==0x05). The original condition (mod != 0x00 && rm != 0x05) incorrectly applied De Morgan's law, causing false positives.

Correct De Morgan's: !(A && B) = !A || !B
Changed to: (mod != 0x00 || rm != 0x05)

8cdd39d: The 3rd and 4th arguments to mmap() were in wrong order. POSIX signature: mmap(addr, length, prot, flags, fd, offset)

@GJDuck GJDuck merged commit eda844b into GJDuck:master Mar 3, 2026
1 check passed
@GJDuck
Copy link
Owner

GJDuck commented Mar 3, 2026

Thanks! The mmap() still worked since those macros happen to have the same value. I am not sure why the RIP-relative detection did not cause problems though.

@ehgus607
Copy link
Contributor Author

ehgus607 commented Mar 3, 2026

Thank you for merging my patches. I’m glad I could contribute to your project :)

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.

2 participants