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

Ability to allocate executable region of memory #7

Closed
dragokas opened this issue Nov 30, 2020 · 2 comments
Closed

Ability to allocate executable region of memory #7

dragokas opened this issue Nov 30, 2020 · 2 comments

Comments

@dragokas
Copy link

Hi,
Can I ask you please to add a native for allocating memory with an executable flag?

I'd like to solve some crash by inserting

if (x != NULL)

in arbitrary place inside the function, so using your extension, I could do a manual detour by jumping to a new executable memory, do a required check, and jump back.

Thanks in advance.
Nice job on this very useful extension!

@nosoop
Copy link
Owner

nosoop commented Dec 1, 2020

Provided you're using StoreToAddress or MemoryBlock.StoreToOffset (which just wraps around the former) to write to the MemoryBlock, it should already be marking the region as executable.

One of my private projects has no problems running executable code in MemoryBlock-allocated space, so I'm not sure that a new native is necessary for this. But if it is, I have no issue with adding it (probably as a permissions property).

I'll leave this issue open for now; please try the extension then report back.

@dragokas
Copy link
Author

dragokas commented Dec 1, 2020

Ahh, I'm sorry, I couldn't imagine that StoreToAddress() already cover that.
I just studying stuff so far, and didn't try to exec anything yet.
If you said, you already did it before, that's great and no additional natives required.
Thanks for clarifying.

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

2 participants