这个函数调用如何工作??? [英] How this function call works???

查看:63
本文介绍了这个函数调用如何工作???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有些人可以帮我解决这里发生的事情...


谢谢..


char sc [] =

" \ x31 \ xc0" / * xor%eax,%eax * /

" \ x50" / * push%eax * /

" \ xx68 \ x2f \ x2f \ x73 \ x68" / * push $ 0x68732f2f * /

" \ xx68 \ x2f \ x62 \ x69 \ x6e" / * push $ 0x6e69622f * /

" \ x89 \ xe3" / * mov%esp,%ebx * /

" \ x50" / * push%eax * /

" \ x53" / * push%ebx * /

" \ x89 \ xe1" / * mov%esp,%ecx * /

" \ x31 \ xd2" / * xor%edx,%edx * /

" \ xb0 \ x0b" / * mov $ 0xb,%al * /

" \ xcd \ x80" ;; / * int $ 0x80 * /


main()

{

void(* fp)(void); //这一行发生了什么


fp =(void *)sc;

fp();

}


-

没有Linux的一天是没有学习的一天!

- Java B?y


---

发表于 news://freenews.netfront.net

投诉 ne ** @ netfront.net


could some body help me what''s happening here...

thanks..

char sc[] =
"\x31\xc0" /* xor %eax, %eax */
"\x50" /* push %eax */
"\x68\x2f\x2f\x73\x68" /* push $0x68732f2f */
"\x68\x2f\x62\x69\x6e" /* push $0x6e69622f */
"\x89\xe3" /* mov %esp,%ebx */
"\x50" /* push %eax */
"\x53" /* push %ebx */
"\x89\xe1" /* mov %esp,%ecx */
"\x31\xd2" /* xor %edx,%edx */
"\xb0\x0b" /* mov $0xb,%al */
"\xcd\x80"; /* int $0x80 */

main()
{
void (*fp) (void); // what is happening at this line

fp = (void *)sc;
fp();
}

--
A day spent without Linux is a day spent without learning!
-- Java B?y


---
Posted via news://freenews.netfront.net
Complaints to ne**@netfront.net

推荐答案

0x68732f2f * /

" \ x68 \ x2f \ x62 \ x69 \ x6e" / * push
0x68732f2f */
"\x68\x2f\x62\x69\x6e" /* push


0x6e69622f * /

" \ x89 \ xe3" / * mov%esp,%ebx * /

" \ x50" / * push%eax * /

" \ x53" / * push%ebx * /

" \ x89 \ xe1" / * mov%esp,%ecx * /

" \ x31 \ xd2" / * xor%edx,%edx * /

" \ xb0 \ x0b" / * mov
0x6e69622f */
"\x89\xe3" /* mov %esp,%ebx */
"\x50" /* push %eax */
"\x53" /* push %ebx */
"\x89\xe1" /* mov %esp,%ecx */
"\x31\xd2" /* xor %edx,%edx */
"\xb0\x0b" /* mov


0xb,%al * /

" \ xcd \ x80" ;; / * int
0xb,%al */
"\xcd\x80"; /* int


这篇关于这个函数调用如何工作???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆