WinHeap.H
网上找到的,对 Windows Heap 有详细的定义。
// file winheap.h
typedef void VOID;
typedef unsigned __int8 UINT8;
typedef unsigned __int16 UINT16;
typedef __int32 LONG32;
typedef unsigned __int32 ULONG32;
typedef unsigned __int64 UINT64; // pseudo struct, for the PEB heap list
struct HEAPTABLE {
struct _HEAP *list[];
}; struct _LIST_ENTRY {
struct _LIST_ENTRY *FLink;
struct _LIST_ENTRY *BLink;
}; union _SLIST_HEADER {
struct _LIST_ENTRY le;
}; typedef struct _HEAP_ENTRY // 7 elements, 0x8 bytes (sizeof)
{
// union // 2 elements, 0x4 bytes (sizeof)
// {
// struct // 2 elements, 0x4 bytes (sizeof)
// {
/*0x000*/ UINT16 Size;
/*0x002*/ UINT16 PreviousSize;
// };
///*0x000*/ VOID* SubSegmentCode;
// };
/*0x004*/ UINT8 SmallTagIndex;
/*0x005*/ UINT8 Flags;
/*0x006*/ UINT8 UnusedBytes;
/*0x007*/ UINT8 SegmentIndex;
}HEAP_ENTRY, *PHEAP_ENTRY; typedef struct _HEAP // 36 elements, 0x588 bytes (sizeof)
{
/*0x000*/ struct _HEAP_ENTRY Entry; // 7 elements, 0x8 bytes (sizeof)
/*0x008*/ ULONG32 Signature;
/*0x00C*/ ULONG32 Flags;
/*0x010*/ ULONG32 ForceFlags;
/*0x014*/ ULONG32 VirtualMemoryThreshold;
/*0x018*/ ULONG32 SegmentReserve;
/*0x01C*/ ULONG32 SegmentCommit;
/*0x020*/ ULONG32 DeCommitFreeBlockThreshold;
/*0x024*/ ULONG32 DeCommitTotalFreeThreshold;
/*0x028*/ ULONG32 TotalFreeSize;
/*0x02C*/ ULONG32 MaximumAllocationSize;
/*0x030*/ UINT16 ProcessHeapsListIndex;
/*0x032*/ UINT16 HeaderValidateLength;
/*0x034*/ VOID* HeaderValidateCopy;
/*0x038*/ UINT16 NextAvailableTagIndex;
/*0x03A*/ UINT16 MaximumTagIndex;
/*0x03C*/ struct _HEAP_TAG_ENTRY* TagEntries;
/*0x040*/ struct _HEAP_UCR_SEGMENT* UCRSegments;
/*0x044*/ struct _HEAP_UNCOMMMTTED_RANGE* UnusedUnCommittedRanges;
/*0x048*/ ULONG32 AlignRound;
/*0x04C*/ ULONG32 AlignMask;
/*0x050*/ struct _LIST_ENTRY VirtualAllocdBlocks; // 2 elements, 0x8 bytes (sizeof)
/*0x058*/ struct _HEAP_SEGMENT* Segments[];
union // 2 elements, 0x10 bytes (sizeof)
{
/*0x158*/ ULONG32 FreeListsInUseUlong[];
/*0x158*/ UINT8 FreeListsInUseBytes[];
}u;
union // 2 elements, 0x2 bytes (sizeof)
{
/*0x168*/ UINT16 FreeListsInUseTerminate;
/*0x168*/ UINT16 DecommitCount;
}u2;
/*0x16A*/ UINT16 AllocatorBackTraceIndex;
/*0x16C*/ ULONG32 NonDedicatedListLength;
/*0x170*/ VOID* LargeBlocksIndex;
/*0x174*/ struct _HEAP_PSEUDO_TAG_ENTRY* PseudoTagEntries;
/*0x178*/ struct _LIST_ENTRY FreeLists[128];
/*0x578*/ struct _HEAP_LOCK* LockVariable;
///*0x57C*/ FUNCT_0049_0C5F_CommitRoutine* CommitRoutine;
/*0x57C*/ VOID* CommitRoutine;
/*0x580*/ VOID* FrontEndHeap;
/*0x584*/ UINT16 FrontHeapLockCount;
/*0x586*/ UINT8 FrontEndHeapType;
/*0x587*/ UINT8 LastSegmentIndex;
}HEAP, *PHEAP; typedef struct _HEAP_UNCOMMMTTED_RANGE // 4 elements, 0x10 bytes (sizeof)
{
/*0x000*/ struct _HEAP_UNCOMMMTTED_RANGE* Next;
/*0x004*/ ULONG32 Address;
/*0x008*/ ULONG32 Size;
/*0x00C*/ ULONG32 filler;
}HEAP_UNCOMMMTTED_RANGE, *PHEAP_UNCOMMMTTED_RANGE; typedef struct _HEAP_ENTRY_EXTRA // 4 elements, 0x8 bytes (sizeof)
{
union // 2 elements, 0x8 bytes (sizeof)
{
struct // 3 elements, 0x8 bytes (sizeof)
{
/*0x000*/ UINT16 AllocatorBackTraceIndex;
/*0x002*/ UINT16 TagIndex;
/*0x004*/ ULONG32 Settable;
};
/*0x000*/ UINT64 ZeroInit;
};
}HEAP_ENTRY_EXTRA, *PHEAP_ENTRY_EXTRA; typedef struct _HEAP_VIRTUAL_ALLOC_ENTRY // 5 elements, 0x20 bytes (sizeof)
{
/*0x000*/ struct _LIST_ENTRY Entry; // 2 elements, 0x8 bytes (sizeof)
/*0x008*/ struct _HEAP_ENTRY_EXTRA ExtraStuff; // 4 elements, 0x8 bytes (sizeof)
/*0x010*/ ULONG32 CommitSize;
/*0x014*/ ULONG32 ReserveSize;
/*0x018*/ struct _HEAP_ENTRY BusyBlock; // 7 elements, 0x8 bytes (sizeof)
}HEAP_VIRTUAL_ALLOC_ENTRY, *PHEAP_VIRTUAL_ALLOC_ENTRY; typedef struct _HEAP_FREE_ENTRY // 8 elements, 0x10 bytes (sizeof)
{
union // 2 elements, 0x4 bytes (sizeof)
{
struct // 2 elements, 0x4 bytes (sizeof)
{
/*0x000*/ UINT16 Size;
/*0x002*/ UINT16 PreviousSize;
};
/*0x000*/ VOID* SubSegmentCode;
};
/*0x004*/ UINT8 SmallTagIndex;
/*0x005*/ UINT8 Flags;
/*0x006*/ UINT8 UnusedBytes;
/*0x007*/ UINT8 SegmentIndex;
/*0x008*/ struct _LIST_ENTRY FreeList; // 2 elements, 0x8 bytes (sizeof)
}HEAP_FREE_ENTRY, *PHEAP_FREE_ENTRY; typedef struct _HEAP_LOOKASIDE // 10 elements, 0x30 bytes (sizeof)
{
/*0x000*/ union _SLIST_HEADER ListHead; // 4 elements, 0x8 bytes (sizeof)
/*0x008*/ UINT16 Depth;
/*0x00A*/ UINT16 MaximumDepth;
/*0x00C*/ ULONG32 TotalAllocates;
/*0x010*/ ULONG32 AllocateMisses;
/*0x014*/ ULONG32 TotalFrees;
/*0x018*/ ULONG32 FreeMisses;
/*0x01C*/ ULONG32 LastTotalAllocates;
/*0x020*/ ULONG32 LastAllocateMisses;
/*0x024*/ ULONG32 Counters[];
/*0x02C*/ UINT8 _PADDING0_[0x4];
}HEAP_LOOKASIDE, *PHEAP_LOOKASIDE; struct FRONTEND1 {
struct _HEAP_LOOKASIDE l[];
}; typedef struct _HEAP_SEGMENT // 15 elements, 0x3C bytes (sizeof)
{
/*0x000*/ struct _HEAP_ENTRY Entry; // 7 elements, 0x8 bytes (sizeof)
/*0x008*/ ULONG32 Signature;
/*0x00C*/ ULONG32 Flags;
/*0x010*/ struct _HEAP* Heap;
/*0x014*/ ULONG32 LargestUnCommittedRange;
/*0x018*/ VOID* BaseAddress;
/*0x01C*/ ULONG32 NumberOfPages;
/*0x020*/ struct _HEAP_ENTRY* FirstEntry;
/*0x024*/ struct _HEAP_ENTRY* LastValidEntry;
/*0x028*/ ULONG32 NumberOfUnCommittedPages;
/*0x02C*/ ULONG32 NumberOfUnCommittedRanges;
/*0x030*/ struct _HEAP_UNCOMMMTTED_RANGE* UnCommittedRanges;
/*0x034*/ UINT16 AllocatorBackTraceIndex;
/*0x036*/ UINT16 Reserved;
/*0x038*/ struct _HEAP_ENTRY* LastEntryInSegment;
}HEAP_SEGMENT, *PHEAP_SEGMENT;
WinHeap.H的更多相关文章
- OD: Heap Overflow (XP SP2 - 2003) & DWORD SHOOT via Chunk Resize
微软在堆中也增加了一些安全校验操作,使得原本是不容易的堆溢出变得困难重重: * PEB Random:在 Windows XP SP2 之后,微软不再使用固定的 PEB 基址 0x7FFDF000,而 ...
- APUE中fcntl.h的使用及O_SYNC在Mac与Ubuntu下的测试
此部分测试涉及到APUE V3中,第三章的图3-12到图3-14. 通过fcntl.h提供的功能,修改fd的文件属性,本处增加O_SYNC功能,并测试其效果. 本文涉及代码: tree ch3 ch3 ...
- 关于apue.3e中apue.h的使用
关于apue.3e中apue.h的使用 近来要学一遍APUE第三版,并于此开博做为记录. 先下载源文件: # url: http://http//www.apuebook.com/code3e.htm ...
- YYModel 源码解读(二)之NSObject+YYModel.h (1)
本篇文章主要介绍 _YYModelPropertyMeta 前边的内容 首先先解释一下前边的辅助函数和枚举变量,在写一个功能的时候,这些辅助的东西可能不是一开始就能想出来的,应该是在后续的编码过程中 ...
- YYModel 源码解读(一)之YYModel.h
#if __has_include(<YYModel/YYModel.h>) FOUNDATION_EXPORT double YYModelVersionNumber; FOUNDATI ...
- error RC1015: cannot open include file 'afxres.h' 解决办法
在为WindowsPhone8程序添加本地化的过程中遇到这个问题: 问题原因就是afxres.h文件缺失,下载它,放到VS安装目录下的VS\include目录下就可以了(选择目录的时候注意对应对版本) ...
- afxcomctl32.h与afxcomctl32.inl报错
afxcomctl32.h与afxcomctl32.inl报错 编译公司一个几年前的老项目,是从VC6.0升级到VS2005的. 1.编译时报缺少头文件,于是附件包含目录,于是出现了以下报错: 1&g ...
- C标准头文件<math.h>
定义域错误可以理解为超出了函数的适用范围,如果发生了定义域错误,设errno为EDOM 如果结果不能表示为double值,则发生值域错误,如果结果上溢,则函数返回HUGE_VAL的值,设errno为E ...
- C标准头文件<ctype.h>
主要包括了一些字符识别和转换函数 字符判断 isalnum() //函数原型 #include<ctype.h> int isalum(int c); 功能:如果输入的字符是字母(alph ...
随机推荐
- javascript学习(知识点整理)
有了这个代码,就可以在定义 中增加更多的控制了 后面会举例关于extjs定义的更多控制 此种方案可以解决定义时需要一些函数调用的情况 函数作用域和声明提前: 即由于js是解释性语言,在执行前会 ...
- 利用xampp进行https操作
环境:win7 32位 安装xampp: 一般情况Apache的端口号可能会冲突,建议修改.修改方法如下: 1.点击Config
- thinkphp 文件下载实例 实现以及注意事项
#下载 function download() { $id=$_GET['id']; $file_name ...
- HTML&CSS基础学习笔记1.33-元素选择器
元素选择器 最常见的 CSS 选择器是元素选择器.换句话说,文档的元素就是最基本的选择器: p { text-indent:10px; color:blue; } 什么情况下使用元素选择器,一般我们这 ...
- python学习之旅:array 转 list
最近学习python,记录学习的点滴. >>> import numpy as np >>> a = np.array([[1,2],[3,4]]) >> ...
- mysql操作之二
特殊数据类型 表约束 表连接 索引 触发器 安全性 DB设计 alter table student modify id int primary key; 主銉不可重复修改 alter table s ...
- 转:assert()函数用法总结
assert宏的原型定义在<assert.h>中,其作用是如果它的条件返回错误,则终止程序执行,原型定义: #include <assert.h>void assert( in ...
- 改进基于Boost.Asio的聊天服务
Boost.Asio是个非常易用的C++异步网络库,官方文档中一个示例是聊天服务,分为chat_message.chat_client.chat_server三个部分.chat_server的启动代码 ...
- ATR的基本结构与意义(无历史字符部分)
Reset 3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 34 31 56 32 32 31 96 复位应答 ATR TS( The Initial character ...
- POJ 3281 牛双选问题
题目大意:有F种食物和D种饮料,每种食物或饮料只能供一头牛享用,且每头牛只享用一种食物和一种饮料.现在有N头牛,每头牛都有自己喜欢的食物种类列表和饮料种类列表,问最多能使几头牛同时享用到自己喜欢的食物 ...