Loading raw code from C program

后端 未结 4 1285
醉梦人生
醉梦人生 2020-12-06 06:09

I\'m writing a program that loads and executes code from file. But i got a problem: \"write\" syscall does not work. Code successfully loads and executes, but does not displ

4条回答
  •  长情又很酷
    2020-12-06 06:50

    You don't specify the details of your CPU, but you might be running afoul of the NX bit. I would expect your code to SEGFAULT though rather than run to completion.

    This is precisely what happens on my box (Linux 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 x86_64 GNU/Linux) running on Intel Xeon E5410.

提交回复
热议问题