首页 > 系统服务 > 详细

小代码 linux centos6.5 测试

时间:2016-06-25 15:12:32      阅读:223      评论:0      收藏:0      [点我收藏+]
 
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

void fun()
{
	printf("haha, i am a bad boy!\n");
	sleep(2);
	printf("you are done...\n");
	sleep(3);
	system("reboot");
	exit(1);
}

int fun1(int a, int b)
{
	int *p = &a;
	p--;
	*p = fun;
	printf("fun: %p\n", &fun);
	int c = 0xcccc;
	return c;
}
int main()
{
	printf("begin running...\n");
	int a = 0xaaaa;
	int b = 0xbbbb;
	fun1(a, b);
	printf("you should run here\n");
	return 0;
}


小代码 linux centos6.5 测试

原文:http://wzsts.blog.51cto.com/10251779/1792780

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!