开发者

Is it possible to allocate a segment using the Windows API?

开发者 https://www.devze.com 2023-03-28 13:09 出处:网络
I am wondering if it is possible for a Windows program to allocate a segment descriptor within the process\' local descriptor table. Is there a Windows API function that can 开发者_开发问答install a n

I am wondering if it is possible for a Windows program to allocate a segment descriptor within the process' local descriptor table. Is there a Windows API function that can 开发者_开发问答install a new segment descriptor to the running process' LDT using a provided linear offset, segment length, and combination of flags (RWX)?


It's possible using undocumented NT API, specifically NtSetLdtEntries. Note that Windows x86-64 does not set up an LDT so this only works on x86.

Here's some code.

0

精彩评论

暂无评论...
验证码 换一张
取 消