【发布时间】:2015-06-24 04:46:37
【问题描述】:
我已经下载并编译了 Apple 的源代码并将其添加到 Xcode.app/Contents/Developer/usr/bin/include/c++/v1。现在我该如何在 C 中实现呢?我正在使用的代码来自this 关于 Hackadays shellcode 执行器的帖子。我的代码目前是这样的:
#include <stdio.h>
#include <stdlib.h>
unsigned char shellcode[] = "\x31\xFA......";
int main()
{
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
printf("2\n");
}
我都编译过:
gcc -fno-stack-protector shell.c
clang -fno-stack-protector shell.c
我想我的最后一个问题是,我如何告诉编译器实现“__enable_execute_stack”?
【问题讨论】: