running shellcode + vs2010

前端 未结 4 1187
春和景丽
春和景丽 2020-12-21 20:34

I just tried the following code snippet for shellcode testing purposes:-

#include

using namespace std;

char sc[] = \"\"; #i\'ve removed the         


        
4条回答
  •  心在旅途
    2020-12-21 21:05

    I think the following should work:

    char sc[] = ""; // i've removed the shellcode
    
    int main()
    {
        int (*func)() = (int(*)())sc;   // C++
        int (*func)() = sc;             /* C  */
        func();
    }
    

    It's technically undefined behaviour, but then again that's the whole point of shellcode.

提交回复
热议问题