How can i execute an executable from memory?

后端 未结 1 785
囚心锁ツ
囚心锁ツ 2020-12-18 03:18

Let\'s say I have included a binary into my program during compilation so, I keep it in a variable something like var myExec =[]byte{\'s\',\'o\',\'m\',\'e\',\' \',\'b\

1条回答
  •  轮回少年
    2020-12-18 03:51

    In C and assuming Linux, you can change the protection of a memory region by means of the mprotect() system call, so that it can be executed (i.e.: turn a data region into a code region). After that, you could execute that region of memory by jumping into it.

    0 讨论(0)
提交回复
热议问题