首页
社区
课程
招聘
[原创]JavaScript中的堆风水,中英文对照版
2007-12-3 09:04 28243

[原创]JavaScript中的堆风水,中英文对照版

2007-12-3 09:04
28243
收藏
点赞7
打赏
分享
最新回复 (32)
雪    币: 267
活跃值: (24)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
youstar 2 2009-12-29 16:07
26
0
正在看英文版的,不料看到有翻译版的,就看看再说!
雪    币: 205
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
yyppaag 2010-1-18 21:53
27
0
楼主辛苦,支持~~研读
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
kauther 2010-1-19 19:46
28
0
下载了 THKS
雪    币: 146
活跃值: (18)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
weizhenjin 2011-8-13 16:09
29
0
不知道怎么样,不过楼主翻译的东西应该是好东西
雪    币: 34
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
zzzzzzx 2011-8-26 16:30
30
0
谢谢  下来看看
雪    币: 411
活跃值: (247)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
blackwhite 1 2014-4-26 20:53
31
0
// The new operator is a wrapper around CMemManager::AllocBuffer. If the

    // size size is less than 0x2000, it allocates a block from a special

    // CMemManager heap, otherwise it is equivalent to:

    //

    // HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size+8) + 8

The KeyFrame function multiplies the npoints argument by 16, 8 and 4 and allocates four buffers. If npoints is greater than 0x40000000 the allocation size will wrap around and the function will allocate four small buffers. In our exploit, we'll set npoints to 0x40000801, and the function will allocate buffers of size 0x8018, 0x4008 and two of size 0x200c. We want the smallest buffer to be larger than 0x2000 bytes because smaller allocations will come from the CMemManager heap instead of the system allocator.

KeyFrame函数把npoints参数乘以16,8和4,然后分配了4个buffer。如果npoints大于0x40000000的话,实际上就溢出了,程序申请的4个buffer就会过小。在我们这个exploit中,我们把npoints写成0x40000801,这样程序要求分配的4个buffer就只有0x8018, 0x4008和2个0x200c。当然我是故意要使最小的那2个buffer大于0x2000的。因为这样这2个buffer就会由CMemManager系列函数,而不是系统的内存分配函数来分配了。

不管是看老外源代码里的注解还是英文,“因为这样这2个buffer就会由CMemManager系列函数,而不是系统的内存分配函数来分配了”,这句话应该译反了吧。
  我想应该是如果buffer小于0x2000才会调CMemManger系列函数吧,不然在咋个能读到你默认堆里面的指针嘛。
雪    币: 411
活跃值: (247)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
blackwhite 1 2014-4-26 20:55
32
0
哦。顶楼主,译得很好哈再看一次又有新收获。
雪    币: 411
活跃值: (247)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
blackwhite 1 2014-4-28 10:53
33
0
逆向了一下mmutilse.dll中的CMemManager系列函数,原来是这个函数会先创建10个堆.最大的是0x2000
如果你要分配的空间小于0x2000,那就就用到预申请的堆,如果大于则在进程默认堆中分配.同时还有
一个64项的缓存机制.
游客
登录 | 注册 方可回帖
返回