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

Implement more space-efficient code managers #28

Open
1 of 2 tasks
alexrp opened this issue Jul 14, 2022 · 1 comment
Open
1 of 2 tasks

Implement more space-efficient code managers #28

alexrp opened this issue Jul 14, 2022 · 1 comment
Assignees
Labels
area: memory Issues related to the memory manipulation APIs. state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests.
Milestone

Comments

@alexrp
Copy link
Sponsor Member

alexrp commented Jul 14, 2022

SimpleCodeManager is functional but really not great. Due to the huge allocation granularity on Windows, it will cause considerable address space fragmentation when hooking multiple functions. This is a serious problem for us because, unlike the average 64-bit application, we actually need our code allocations to be near the code we're hooking.

We need two additional code managers:

  • PageCodeManager: Allocates from the OS using the system allocation granularity. Hands out a full page for each code allocation. Enforces W^X.
  • BlockCodeManager: Allocates from the OS using the system allocation granularity. Hands out tiny blocks of memory for each code allocation. Always RWX (no W^X support).

Maybe also rename SimpleCodeManager to something like SparseCodeManager. Or just nuke it. 🤷

@alexrp alexrp added state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests. area: hooking Issues related to the function hooking APIs. labels Jul 14, 2022
@alexrp alexrp added this to the v2.0 milestone Jul 14, 2022
@alexrp alexrp self-assigned this Jul 14, 2022
@alexrp alexrp modified the milestones: v2.0, v1.0 Jul 14, 2022
@alexrp
Copy link
Sponsor Member Author

alexrp commented Jul 16, 2022

PageCodeManager done in 0acd47d. SimpleCodeManager was nuked.

@alexrp alexrp modified the milestones: v1.0, v2.0 Jul 16, 2022
@alexrp alexrp added area: memory Issues related to the memory manipulation APIs. and removed area: hooking Issues related to the function hooking APIs. labels Jul 28, 2022
@alexrp alexrp modified the milestones: v3.0, v4.0 Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: memory Issues related to the memory manipulation APIs. state: approved Feature requests and housekeeping tasks that have been approved. type: feature Issues that are classified as feature requests.
Development

No branches or pull requests

1 participant