当前位置:首页 » 服务器技术
开发技术指南» 文章正文
    引言: 转自安焦 总结windows下堆溢出的三种利用方式1.利用Rt
 

 

 ·seo guide(转载)    »显示摘要«
    摘要: body{font: arial; font-size: 14px;} td {font: arial; font-size: 14px;} .style2 {color: #000000} .style3 {font-family: "courier new", courier, mono} seo guideby daniel kerrcreated on 3rd september 2004......
 ·[原创]java反射技术(一)    »显示摘要«
    摘要:java的反射技术功能十分强大,整理一些资料!! (如需转载,请注明出处!) lesson: 检测类examing class 1.retrieving class objects 获取一个class对象(metadata) a,从对象的实例获取。class c = mystery.getclass();//(return class)b,从子类的实例获取textfield t = new textfield(); class c = t.getc......


总结windows下堆溢出的三种利用方式

转自安焦

【相关文章:自己用PHP写的一个日历

总结windows下堆溢出的三种利用方式 【扩展阅读:AbstractCollection源码

【扩展信息:struts学习笔记(2)

1.利用rtlallocheap

这是isno提到的,看这个例子

main (int argc, char *argv[])

{

??char *buf1, *buf2;

??char s[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\x03\x00\x05\x00\x00\x01\x08\x00\x11\x11\x11\x11\x21\x21\x21\x21";

??buf1 = (char*)malloc (32); /* 分配两块内存 */

??memcpy (buf1, s, 32+16); /* 这里多复制16个字节 */

??buf2 = (char*)malloc (16);

??free (buf1);

??free (buf2);

??return 0;

}

在给buf1完成malloc之后,返回的地址(buf1)是个指针,指向的内存分配情况是这样

buf1的管理结构(8bytes)|buf1真正可操作空间(32bytes)|下一个空闲堆的管理结构(8bytes)|两个双链表指针(8bytes)

在给buf2完成malloc之后,buf1指向的内存分配情况是这样

buf1的管理结构(8bytes)|buf1真正可操作空间(32bytes)|buf2的管理结构(8bytes)|buf2真正可操作空间(16bytes)|两个双链表指针(8bytes)

现在如果在buf2分配空间之前,buf1的memcpy操作溢出,并且覆盖了

下一个空闲堆的管理结构(8bytes)|两个双链表指针(8bytes)

共16个字节的时候,就会造成buf2的rtlallocheap操作异常。原因看rtlallocheap的这段代码

001b:77fcc453??8901????????????????mov?????? [ecx],eax


...   下一页
 ·[原创]java反射技术(二)     »显示摘要«
    摘要:lesson:2 处理对象1.creating objects 一般情况下,创建一个对象用以下方法rectangle r = new rectangle();但如果你正在开发一个development tools,在运行之前或许不知道要生成对象的类。所以要像下面这样来创建对象:string classname; // . . . load classname from the user interface object o = new (classn......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE