Skip to content

Implement more space-efficient code managers #28

@alexrp

Description

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. 🤷

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

area: memoryIssues related to the memory manipulation APIs.state: approvedEnhancements and tasks that have been approved.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions