CS计算机代考程序代写 /* Magic function to disable stack randomization for the current program. */

/* Magic function to disable stack randomization for the current program. */
#include
#include

static void unrandomize(int argc, char **argv) {
int p = personality(0xFFFFFFFF);
if((p & PER_MASK) != PER_LINUX || !(p & ADDR_NO_RANDOMIZE)) {
personality(PER_LINUX | ADDR_NO_RANDOMIZE);
execvp(argv[0], argv);
}
}