Skip to main content

force_nx

Function force_nx 

Source
pub fn force_nx() -> Rule
Expand description

No-execute stays on in every 32-bit process.

i386 code runs under FEX. Wine turns no-execute off for a 32-bit process when its executable or a DLL it loads lacks the NX_COMPAT flag, as many older games do, and FEX then has to retranslate code whenever writable memory changes. With force_nx, our ntdll keeps no-execute permanently on instead; it reads the value the first time the process asks for or changes its execute flags, long after compatdb has handed it over. A 64-bit process always has no-execute on, so the setting does nothing there.

A program that runs code from memory it did not make executable crashes with it. That includes programs built with the ATL of Visual Studio 2003, such as game configurators and launchers, whose window thunks live on the heap: Windows emulates such thunks, but in a WoW64 process under FEX neither Wine nor FEX does, so the first window message faults.

It matches every process, like the other defaults. A rule for one program with force_nx = false gives that program Wine’s behaviour again, and only that program: the value is the process’s own, so the programs it starts keep this default. A * rule with it does that for every process.