- 论坛徽章:
- 0
|
我的
00000000 <hook>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 ec 0c sub $0xc,%esp
7: 8b 5d 08 mov 0x8(%ebp),%ebx
a: 53 push %ebx
b: 68 00 00 00 00 push $0x0
10: e8 fc ff ff ff call 11 <hook+0x11>
15: 8d 04 5b lea (%ebx,%ebx,2),%eax
18: d1 e0 shl %eax
1a: 8b 5d fc mov 0xfffffffc(%ebp),%ebx
1d: c9 leave
1e: c3 ret
1f: 90 nop
你的
00000060 <hacked_alarm>:
60: 53 push %ebx
61: 89 c3 mov %eax,%ebx //系统调用号存入ebx
63: 83 ec 08 sub $0x8,%esp
66: 89 44 24 04 mov %eax,0x4(%esp)//系统调用号压栈
6a: c7 04 24 30 00 00 00 movl $0x30,(%esp)
71: e8 fc ff ff ff call 72 <hacked_alarm+0x12>
76: 8d 04 5b lea (%ebx,%ebx,2),%eax
79: 01 c0 add %eax,%eax
7b: 83 c4 08 add $0x8,%esp
7e: 5b pop %ebx
7f: c3 ret
说明引用参数方式出现问题
你把int hook(int arg)改成
__attribute__((regparm(0))) int hook(int arg)看看 |
|