分类: WINDOWS
2009-05-18 16:15:14
C:\Windows\Cookies\index.dat C:\Windows\History\History.IE5\index.dat C:\Windows\Temporary Internet Files\Content.IE5\index.dat |
C:\Documents and Settings\
C:\Documents and Settings\ C:\Documents and Settings\ \Temporary Internet Files\Content.IE5\index.dat |
struct CacheDir
{
DWORD nFileCount;
CHAR sDirName[8];
};
typedef struct _MEMMAP_HEADER_SMALL
{
TCHAR FileSignature[28]; //”Client UrlCache MMF Ver 5.2”
DWORD FileSize; //index.dat文件的大小
DWORD dwHashTableOffset; //第一个哈希表的偏移
DWORD NumUrlInternalEntries;
DWORD NumUrlEntriesAlloced;
// DWORD dwGarbage; // 无效数据,只在/Zp8编译使用
LONGLONG CacheLimit;
LONGLONG CacheSize;
LONGLONG ExemptUsage;
DWORD nDirCount; //子目录个数
CacheDir DirArray[32]; //子目录名称
DWORD dwHeaderData[33];
} MEMMAP_HEADER_SMALL;
typedef struct _MEMMAP_HEADER : _MEMMAP_HEADER_SMALL
{
DWORD AllocationBitMap[3948];
} MEMMAP_HEADER, *LPMEMMAP_HEADER; |
typedef struct FILEMAP_ENTRY
{
DWORD dwSig; //条目标识
DWORD nBlocks; //条目占用多少个快(128字节)
} *LPFILEMAP_ENTRY;
|
表示字 |
值 |
说明 |
SIG_FREE |
0xbadf00d |
本条目空闲,只有此类条目没有nBlocks成员。 |
SIG_ALLOC |
0xdeadbeef |
已分配 |
SIG_URL |
' LRU' |
URL值 |
SIG_REDIR |
'RDER' |
REDIR |
SIG_LEAK |
'KAEL' |
LEAK |
SIG_GLIST |
'GLST' |
GLIST |
SIG_HASH |
'HSAH' |
哈希表 |
struct HASH_FILEMAP_ENTRY : FILEMAP_ENTRY
{
DWORD dwNext; // 下一个哈希表偏移(0表示为最后一个)
//偏移以index.dat文件第0字节为基地址。
DWORD nBlock; // 本哈希表的序列号。从0,1,2…….
}; |
PRIVATE DWORD HashKey (LPCSTR lpsz)
{
union
{
DWORD dw;
BYTE c[4];
}
Hash, Hash2;
const static BYTE bTranslate[256] =
{
1, 14,110, 25, 97,174,132,119,138,170,125,118, 27,233,140, 51,
87,197,177,107,234,169, 56, 68, 30, 7,173, 73,188, 40, 36, 65,
49,213,104,190, 57,211,148,223, 48,115, 15, 2, 67,186,210, 28,
12,181,103, 70, 22, 58, 75, 78,183,167,238,157,124,147,172,144,
176,161,141, 86, 60, 66,128, 83,156,241, 79, 46,168,198, 41,254,
178, 85,253,237,250,154,133, 88, 35,206, 95,116,252,192, 54,221,
102,218,255,240, 82,106,158,201, 61, 3, 89, 9, 42,155,159, 93,
166, 80, 50, 34,175,195,100, 99, 26,150, 16,145, 4, 33, 8,189,
121, 64, 77, 72,208,245,130,122,143, 55,105,134, 29,164,185,194,
193,239,101,242, 5,171,126, 11, 74, 59,137,228,108,191,232,139,
6, 24, 81, 20,127, 17, 91, 92,251,151,225,207, 21, 98,113,112,
84,226, 18,214,199,187, 13, 32, 94,220,224,212,247,204,196, 43,
249,236, 45,244,111,182,153,136,129, 90,217,202, 19,165,231, 71,
230,142, 96,227, 62,179,246,114,162, 53,160,215,205,180, 47,109,
44, 38, 31,149,135, 0,216, 52, 63, 23, 37, 69, 39,117,146,184,
163,200,222,235,248,243,219, 10,152,131,123,229,203, 76,120,209
};
// Seed the hash values based on the first character.
Hash.c[0] = bTranslate[ *lpsz];
Hash.c[1] = bTranslate[(*lpsz+1) & 255];
Hash.c[2] = bTranslate[(*lpsz+2) & 255];
Hash.c[3] = bTranslate[(*lpsz+3) & 255];
while (*++lpsz)
{
// Allow URLs differing only by trailing slash to collide.
if (lpsz[0] == '/' && lpsz[1] == 0)
break;
Hash2.c[0] = Hash.c[0] ^ *lpsz;
Hash2.c[1] = Hash.c[1] ^ *lpsz;
Hash2.c[2] = Hash.c[2] ^ *lpsz;
Hash2.c[3] = Hash.c[3] ^ *lpsz;
Hash.c[0] = bTranslate[Hash2.c[0]];
Hash.c[1] = bTranslate[Hash2.c[1]];
Hash.c[2] = bTranslate[Hash2.c[2]];
Hash.c[3] = bTranslate[Hash2.c[3]];
}
return Hash.dw;
} |
|
位置0 |
位置1 |
位置2 |
… |
位置6 |
哈希地址0 |
|
|
|
|
|
1 |
|
|
|
|
|
… |
|
|
|
|
|
… |
|
|
|
|
|
63 |
|
|
|
|
|
struct HASH_ITEM
{
DWORD dwHash; //哈希值,注意最后6位为0
DWORD dwOffset; //指向的实体中的记录部分的偏移
//偏移以index.dat文件第0字节为基地址。
}; |
#define HASH_BIT_NOTURL 0x0001 // 位0
#define HASH_BIT_LOCK 0x0002 //位1
#define HASH_BIT_REDIR 0x0004 //位2
#define HASH_BIT_HASGRP 0x0008 //位3
#define HASH_BIT_MULTGRP 0x0010 //位4
#define HASH_BIT_RESERVED 0x0020 //位5
// 上面的哈希值组合
#define HASH_UNLOCKED 0 // URL条目,没被锁定
#define HASH_FREE 1 // 空闲项,以前曾被使用过
#define HASH_LOCKED 2 // URL条目, 已锁定
#define HASH_END 3 // 空闲项,没被使用过
#define HASH_UNLOCKED_SLASH 4 // URL entry, not locked, trailing slash redir
#define HASH_REDIR 5 // redirect entry
#define HASH_LOCKED_SLASH 6 // URL entry, locked, trailing slash redir
#define HASH_FLAG_MASK 7 // illegal, used to mask out hash flags |
struct IE5_URL_FILEMAP_ENTRY : FILEMAP_ENTRY
{
LONGLONG LastModifiedTime; //最后修改时间
LONGLONG LastAccessedTime; //最后访问时间
DWORD dostExpireTime; //到期时间
DWORD dostPostCheckTime;
DWORD dwFileSize; //硬盘缓存中的文件的大小
DWORD dwRedirHashItemOffset; // ask DanpoZ
DWORD dwGroupOffset;
union
{
DWORD dwExemptDelta; // for SIG_URL
DWORD dwNextLeak; // for SIG_LEAK
};
DWORD CopySize; // 好像总是0x60
DWORD UrlNameOffset; // URL名称偏移。基地址是本URL条目的开始地址
BYTE DirIndex; // 属于的子文件夹索引
BYTE bSyncState; // automatic sync mode state
BYTE bVerCreate; // 建立本ENTRY的CACHE的版本
BYTE bVerUpdate; // 升级本ENTRY的CACHE的版本
DWORD InternalFileNameOffset; //硬盘上文件名(不包括目录)字符串的偏移,
//基地址是本URL条目的开始地址。
DWORD CacheEntryType; //缓存类型
DWORD HeaderInfoOffset; //从WEB服务器中取本文件时的返回的HTTP头部信息
DWORD HeaderInfoSize; //和大小(注意包括最后的回车换行的)
DWORD FileExtensionOffset; // should be WORD
DWORD dostLastSyncTime;
DWORD NumAccessed; // 存取次数(点击率)
DWORD NumReferences; // 引用次数
DWORD dostFileCreationTime; // 好像是ULONG?
}; |
struct REDIR_FILEMAP_ENTRY : FILEMAP_ENTRY
{
DWORD dwItemOffset; // offset to hash table item of destination URL
DWORD dwHashValue; // destination URL hash value (BUGBUG: collisions?)
char szUrl[4]; // original URL, can occupy more bytes
}; |
struct LIST_FILEMAP_ENTRY : FILEMAP_ENTRY
{
DWORD dwNext; // offset to next element in list
DWORD nBlock; // sequence number for this block
}; |
请求报文 |
回应报文 |
GET /test.asp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-
powerpoint, application/msword, */*
Accept-Language: en
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: 90.0.0.6
Connection: Keep-Alive |
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 26 Oct 2006 06:43:45 GMT
X-Powered-By: ASP.NET
Content-Length: 903
Content-Type: text/html
Set-Cookie: name=xiaoming; expires=Wed, 30-May-2007 16:00:00 GMT; path=/
Set-Cookie: ASPSESSIONIDASARBACA=NOMPFILDEICPMBJBKCDGKGDC; path=/
Cache-control: private |
GET /img/1.gif HTTP/1.1
Accept: */*
Referer:
Accept-Language: en
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: 90.0.0.6
Connection: Keep-Alive
Cookie: name=xiaoming; ASPSESSIONIDASARBACA=NOMPFILDEICPMBJBKCDGKGDC |
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
X-Powered-By: ASP.NET
Date: Thu, 26 Oct 2006 06:43:45 GMT
Content-Type: image/gif
Accept-Ranges: bytes
Last-Modified: Sun, 15 Oct 2006 15:54:58 GMT
ETag: "075bc4372f0c61:19f8"
Content-Length: 66806 |
00005150h: 01 00 00 00 00 9F 03 00 01 00 00 00 00 FD 03 00 ; .....?......?.
00005160h: 40 53 7F 12 80 66 00 00 40 E7 8F A7 80 F2 01 00 ; @S.
给主人留下些什么吧!~~
|