-
Notifications
You must be signed in to change notification settings - Fork 155
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
VirtualAllocEx fails on large image size #3
Comments
the first parameter is NULL means Windows will determines where to allocate the region. |
try to increase the stack size |
@whitehat84 Thanks for the answer. Can you be more specific,which parameter should I change in this function:
|
@masoudr Hi. How do you solve this problem? I have this challenge. Thanks |
Hi, I have the same issue - but I found at least something that made it much better: // Allocate memory for the context. this and the increased stack size to 8MB ... makes it work for about 85% maybe this helps you to finally fix it, I am a newbe in this topics |
Ok I FIXED IT ... works perfect for me :-) replace with CTX = (LPCONTEXT)(VirtualAlloc(NULL, sizeof(*CTX), MEM_COMMIT, PAGE_READWRITE)); and replace : with pImageBase = VirtualAllocEx(PI.hProcess, NULL, NtHeader->OptionalHeader.SizeOfImage, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); and replace with WriteProcessMemory(PI.hProcess, (LPVOID)(CTX->Ebx + 8), (LPVOID)(&pImageBase), 4, 0); |
Hi, I have one error. It says this "E0135 class "_CONTEXT" has no member "Ebx"". |
@PoloNX It is because |
Hi,
I'm testing your code it works fine for small image size (like 200KB). But on large image arrays, I get
ERROR_INVALID_PARAMETER
on VirtualAllocEx because it is trying to access reserved memory.So I search and ended up to this topic. But I can't figure it out because I think it is going too complicated. How can we just call
VirtualAllocEx
without specifying a specific address?Thanks
The text was updated successfully, but these errors were encountered: