Is it possible to allocate a segment using the Windows API?
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.
精彩评论