Getting "execute" permission for an area of memory
I am using C++, and开发者_C百科 would like to get the permission to execute on an area of memory. Is there a way I can do this? Right now when I just try to execute it, I get an access violation error.
On Windows the function is VirtualProtect, you'll want to pass in PAGE_EXECUTE_READWRITE to get execute permission.
By default Windows does not allow memory. It's called Data Execute Prevention (DEP).
精彩评论