Executing machine code in memory

后端 未结 9 1472
盖世英雄少女心
盖世英雄少女心 2020-12-04 12:47

I\'m trying to figure out how to execute machine code stored in memory.

I have the following code:

#include 
#include          


        
9条回答
  •  温柔的废话
    2020-12-04 13:23

    Use the operating system for loading and executing programs.

    On unix, the exec calls can do this.

    Your snippet in the question could be rewritten:

    #include 
    #include 
    #include 
    
    int main(int argc, char* argv[])
    {
        return execv(argv[1],argv+2);
    }
    

提交回复
热议问题