Skip to content

Scan all PT_LOAD segments on Linux for mm_FindPattern#251

Merged
psychonic merged 1 commit intoalliedmodders:masterfrom
azzyr:patch-1
Jan 4, 2026
Merged

Scan all PT_LOAD segments on Linux for mm_FindPattern#251
psychonic merged 1 commit intoalliedmodders:masterfrom
azzyr:patch-1

Conversation

@azzyr
Copy link
Copy Markdown
Contributor

@azzyr azzyr commented Jan 4, 2026

Unlike in x86 where .rodata might be in the same segment as .text (or at least close enough that PAGE_ALIGN_UP covered it by luck here lol), x64 strictly separates .rodata into its own PF_R only segment. As mm_GetLibraryInfo would only scan the first segment with executable permissions on linux, it would cause mm_FindPattern to miss .rodata in x64

This PR matches the behavior of the Windows and macOS implementations of mm_FindPattern by going over all of the module's PT_LOAD segments instead

this matches the behavior of the Windows and macOS implementations which correctly scan the entire module
Copy link
Copy Markdown
Member

@psychonic psychonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@psychonic psychonic merged commit d6476a4 into alliedmodders:master Jan 4, 2026
4 checks passed
@azzyr azzyr deleted the patch-1 branch January 4, 2026 18:58
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