How do you define a block of executable memory in windows?

前端 未结 2 1316
既然无缘
既然无缘 2021-01-21 18:12

I know that Linux supports the mmap system command for being able to define a block of executable memory. How do you do the same thing in windows? I imagine there i

2条回答
  •  生来不讨喜
    2021-01-21 18:46

    Call CreateFileMapping or VirtualProtect or VirtualAlloc passing one of the PAGE_EXECUTE_XXX protection flags. The mmap function is used for file mappings and so CreateFileMapping is the closest Windows analogue.

提交回复
热议问题