首页
社区
课程
招聘
[求助]sub esp之后,如果清空这块堆栈的数据
发表于: 2009-6-10 21:59 3930

[求助]sub esp之后,如果清空这块堆栈的数据

2009-6-10 21:59
3930
程序反汇编中
sub esp,0x100

从堆栈里面看,这块内存数据全都是00000000
可是通过内联汇编直接这样写的话,堆栈里面的数据全都是非零的,比如
0012F740   00200020
0012F744   00200020
0012F748   00200020

这种通过sub esp出来的内存怎么才能清零呢(写循环代码逐一清零除外)?

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (5)
雪    币: 2067
活跃值: (82)
能力值: ( LV9,RANK:180 )
在线值:
发帖
回帖
粉丝
2
add esp, 100h
xor eax,eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
push eax
2009-6-10 22:05
0
雪    币: 393
活跃值: (100)
能力值: ( LV6,RANK:80 )
在线值:
发帖
回帖
粉丝
3
mov ecx,0x100
sub esp,ecx
mov edi,esp
mov al,0
rep stosb

好久没用过asm了...这样应该可以
2009-6-10 22:54
0
雪    币: 92
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
受累了……
2009-6-11 08:35
0
雪    币: 92
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
嗯,看来只能这么写了……
2009-6-11 08:36
0
雪    币: 454
活跃值: (1673)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
6
按照Delphi编译器的做法,一般类似于:

   mov ecx,0x40
    xor eax,eax
loop:
    push eax
    dec ecx
    jnz loop
2009-6-11 08:47
0
游客
登录 | 注册 方可回帖
返回
//