当前位置: 技术问答>linux和unix
Linux汇编代码...各位帮帮忙
来源: 互联网 发布时间:2015-07-13
本文导语: 0x80481a6 : movl $0x806f308,0xfffffff8(%ebp) # 0xfffffff8(%ebp) 是 ebp-8 的意思吗? 0x80481ad : movl $0x0,0xfffffffc(%ebp) # 0xfffffffc(%ebp) 是 ebp-c 的意思吗? 附:#include int main ( int argc, char * argv[] ) { char * name[2]; ...
0x80481a6 : movl $0x806f308,0xfffffff8(%ebp)
# 0xfffffff8(%ebp) 是 ebp-8 的意思吗?
0x80481ad : movl $0x0,0xfffffffc(%ebp)
# 0xfffffffc(%ebp) 是 ebp-c 的意思吗?
附:#include
int main ( int argc, char * argv[] )
{
char * name[2];
name[0] = "/bin/ksh";
name[1] = NULL;
execve( name[0], name, NULL );
return 0;
}
Dump of assembler code for function main:
0x80481a0 : pushl %ebp
0x80481a1 : movl %esp,%ebp
0x80481a3 : subl $0x8,%esp
0x80481a6 : movl $0x806f308,0xfffffff8(%ebp)
0x80481ad : movl $0x0,0xfffffffc(%ebp)
0x80481b4 : pushl $0x0
0x80481b6 : leal 0xfffffff8(%ebp),%eax
0x80481b9 : pushl %eax
0x80481ba : movl 0xfffffff8(%ebp),%eax
0x80481bd : pushl %eax
0x80481be : call 0x804b9b0
0x80481c3 : addl $0xc,%esp
0x80481c6 : xorl %eax,%eax
0x80481c8 : jmp 0x80481d0
0x80481ca : leal 0x0(%esi),%esi
0x80481d0 : leave
0x80481d1 : ret
End of assembler dump.
(gdb) disas __execve
# 0xfffffff8(%ebp) 是 ebp-8 的意思吗?
0x80481ad : movl $0x0,0xfffffffc(%ebp)
# 0xfffffffc(%ebp) 是 ebp-c 的意思吗?
附:#include
int main ( int argc, char * argv[] )
{
char * name[2];
name[0] = "/bin/ksh";
name[1] = NULL;
execve( name[0], name, NULL );
return 0;
}
Dump of assembler code for function main:
0x80481a0 : pushl %ebp
0x80481a1 : movl %esp,%ebp
0x80481a3 : subl $0x8,%esp
0x80481a6 : movl $0x806f308,0xfffffff8(%ebp)
0x80481ad : movl $0x0,0xfffffffc(%ebp)
0x80481b4 : pushl $0x0
0x80481b6 : leal 0xfffffff8(%ebp),%eax
0x80481b9 : pushl %eax
0x80481ba : movl 0xfffffff8(%ebp),%eax
0x80481bd : pushl %eax
0x80481be : call 0x804b9b0
0x80481c3 : addl $0xc,%esp
0x80481c6 : xorl %eax,%eax
0x80481c8 : jmp 0x80481d0
0x80481ca : leal 0x0(%esi),%esi
0x80481d0 : leave
0x80481d1 : ret
End of assembler dump.
(gdb) disas __execve