I have this snippet in my code
void jmp_esp()
{
__asm__("jmp *%esp");
}
when compiling with gcc
gcc aslr.c -o aslr -ggdb -fno-stack-protector -z execstack
i get this error.
aslr.c: Assembler messages:
aslr.c:6: Error: operand type mismatch for `jmp'
Why this line is failing to compile although the assembly instruction is valid ?
I've read about DEP (Data Execution Prevention). could it be that this feature is creating this compilation error ? if so, how to disable it ?