如何在Windows中定义可执行内存块? [英] How do you define a block of executable memory in windows?
本文介绍了如何在Windows中定义可执行内存块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道Linux支持mmap
系统命令,以便能够定义可执行内存块.您如何在Windows中做同样的事情?我想有一些等效的Windows功能可以执行相同的操作,也许是这样?
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 is some windows equivalent function that does the same thing, maybe?
推荐答案
致电 VirtualProtect
或 PAGE_EXECUTE_XXX
保护标志. mmap
函数用于文件映射,因此CreateFileMapping
是最接近Windows的类似物.
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.
这篇关于如何在Windows中定义可执行内存块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文