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/<username>/Cookies/index.dat
C:/Documents and Settings/<username>/Local Settings/History/History.IE5/index.dat C:/Documents and Settings/<username>/Local 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: http://90.0.0.6/test.asp
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.
€
f..@
鐝
?.
00005170h: C0 68 1D 59 80 1B 03 00 01 00 00 00 00 48 03 00 ;
纇.Y
€
........H..
00005180h: 01 00 00 00 00 6C 0E 00 01 00 00 00 00 93 03 00 ; .....l.......?.
00005190h: 01 00 00 00 00 B6 03 00 C0 48 BE F4 00 D0 00 ; .....?.
繦爵.?
|
00006680h: 55 52 4C 20 03 00 00 00 00 75 BC 43 72 F0 C6 01 ; URL .....u
糃
r
鹌
.
00006690h: 50 AC 0D 1D CC F8 C6 01 00 00 00 00 00 00 00 00 ; P?.
跳?........
000066a
0h: F6 04 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ?..............
000066b0h: 60 00 00 00 68 00 00 00 05 01 10 10 84 00 00 00 ; `...h.......?..
000066c
0h: 41 00 00 00 90 00 00 00 82 00 00 00 00 00 00 00 ; A...?..?......
000066d0h: 5A 35 49 37 02 00 00 00 00 00 00 00 5A 35 02 35 ; Z5I7........Z5.5
000066e0h: 00 00 00 00 0D F0 AD 0B 68 74 74 70 3A 2F 2F 39 ; .....
瓠.http://9
000066f
0h: 30 2E 30 2E 30 2E 36 2F 69 6D 67 2F 31 2E 67 69 ; 0.0.0.6/img/1.gi
00006700h: 66 00 AD 0B 31 5B 31 5D 2E 67 69 66 00 F0 AD 0B ; f.?1[1].gif.
瓠.
00006710h: 48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D ; HTTP/1.1 200 OK.
00006720h: 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 41 ; .X-Powered-By: A
00006730h: 53 50 2E 4E 45 54 0D 0A 43 6F 6E 74 65 6E 74 2D ; SP.NET..Content-
00006740h: 54 79 70 65 3A 20 69 6D 61 67 65 2F 67 69 66 0D ; Type: image/gif.
00006750h: 0A 45 54 61 67 3A 20 22 30 37 35 62 63 34 33 37 ; .ETag: "075bc437
00006760h: 32 66 30 63 36 31 3A 31 39 66 38 22 0D 0A 43 6F ; 2f0c61:19f8"..Co
00006770h: 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 36 36 ; ntent-Length: 66
00006780h: 38 30 36 0D 0A 0D 0A 7E 55 3A 71 67 6D 69 73 0D ; 806....~U:qgmis.
00006790h: 0A 00 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B ; ..?.
瓠..瓠..瓠.
000067a
0h: 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B ; .
瓠..瓠..瓠..瓠.
000067b0h: 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B ; .
瓠..瓠..瓠..瓠.
000067c
0h: 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B ; .
瓠..瓠..瓠..瓠.
000067d0h: 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B ; .
瓠..瓠..瓠..瓠.
000067e0h: 0D F0 AD 0B 0D F0 AD 0B 0D F0 AD 0B 0D F0 ; .
瓠..瓠..瓠..
|
地址
|
成员
|
值
|
说明
|
00006680h
|
dwSig
|
55 52 4C 20
|
URL
|
00006684h
|
nBlocks
|
02 00 00 00
|
此条目占据
2
×
128
=
256
个字节
|
地址
|
成员
|
值
|
说明
|
00006680h
|
LastModifiedTime
|
75 BC 43 72 F0 C6 01
|
最后修改时间:
2006-10-15
11
:
54
:
58 PM
|
|
LastAccessedTime
|
50 AC
0D 1D CC F8 C6 01
|
最后存取时间:
2006-10-26
02
:
58
:
17 PM
|
|
dostExpireTime
|
00 00 00 00
|
|
|
dostPostCheckTime
|
00 00 00 00
|
|
|
dwFileSize
|
F6 04 01 00
|
硬盘缓存的文件大小
0x104F6
|
|
dwRedirHashItemOffset
|
00 00 00 00
|
|
|
dwGroupOffset
|
00 00 00 00
|
|
|
dwExemptDelta
|
00 00 00 00
|
|
|
CopySize
|
60 00 00 00
|
|
|
UrlNameOffset
|
68 00 00 00
|
URL
地址保存在偏移为
0X68
即
0X66E8
的位置处。
(
http://90.0.0.6/img/1.gif
)
|
|
DirIndex
|
0
5
|
硬盘文件子目录序号为:
05
|
|
bSyncState
|
01
|
|
|
bVerCreate
|
10
|
|
|
bVerUpdate
|
10
|
|
|
InternalFileNameOffset
|
84 00 00 00
|
硬盘缓存文件名保存在偏移为
0X84
即
0X6704
的位置处。
(
1[1].gif
)
|
|
CacheEntryType
|
41 30 00 00
|
|
|
HeaderInfoOffset
|
90 00 00 00
|
HTTP
首部信息保存在偏移为
0X90
即
0X6710
的位置处。
(
HTTP/1.1 200 OK
X-Powered-By: ASP.NET
Content-Type: image/gif
ETag: "075bc4372f0c61:19f8"
Content-Length: 66806
~U:qgmis
)
|
|
HeaderInfoSize
|
82
00 00 00
|
HTTP
首部信息大小。
|
|
FileExtensionOffset
|
00 00 00 00
|
|
|
dostLastSyncTime
|
5A
35 49 37
|
最后同步时间为
: 2006-10-26
02
:
58
:
18 PM
|
|
NumAccessed
|
0
2
00 00 00
|
存取
3
次
|
|
NumReferences
|
00 00 00 00
|
|
|
dostFileCreationTime
|
5A
35
02
35
|
文件建立时间
|
请求报文
|
回应报文
|
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
Cookie: name=xiaoming
|
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Thu, 26 Oct 2006 07:01:33 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=OOMPFILDPDCEKPECJOOCPJEP; path=/
Cache-control: private
|
GET /img/1.gif HTTP/1.1
Accept: */*
Referer: http://90.0.0.6/test.asp
Accept-Language: en
Accept-Encoding: gzip, deflate
If-Modified-Since: Sun, 15 Oct 2006 15:54:58 GMT
If-None-Match: "075bc4372f0c61:19f8"
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=OOMPFILDPDCEKPECJOOCPJEP
|
HTTP/1.1 304 Not Modified
Server: Microsoft-IIS/5.0
Date: Thu, 26 Oct 2006 07:01:33 GMT
X-Powered-By: ASP.NET
ETag: "075bc4372f0c61:19f8"
Content-Length: 0
|