|
|

楼主 |
发表于 2005-4-3 23:03:53
|
显示全部楼层
- void main()
- {
- 3 __asm__(
- 4 "jmp 0x0"
- 5 "popl %esi"
- 6 "movl %esi,0x8(%esi)"
- 7 "movb $0x0,0x7(%esi)"
- 8 "movl $0x0,0xc(%esi)"
- 9 "movl $0xb,%eax"
- 10 "movl %esi,%ebx"
- 11 "leal 0x8(%esi),%ecx"
- 12 "leal 0xc(%esi),%edx"
- 13 "int $0x80"
- 14 "movl $0x1, %eax"
- 15 "movl $0x0, %ebx"
- 16 "int $0x80"
- 17 "call 0x0"
- 18 ".string "/bin/sh""
- 19 );
- }
复制代码
很感谢楼上各位特别是doubleelec的回帖
每行加引号后
$gcc shellcode.c
/tmp/ccz89qcn.s Assembler messages:
/tmp/ccz89qcn.s: 13: Error: junk `popl %esimovl %esi` after expression
/tmp/ccz89qcn.s: 13: Error: too many memory references for `jmp`
请问/tmp/ccz89qcn.s是什么东西?编译过程怎么会出现?什么作用?该怎么解决
小弟第一次接触C中嵌入汇编,问得很菜,请见谅. |
|