wab文件格式分析

转载 2006年06月22日 09:24:00
referred from http://www.vbcity.com/forums/topic.asp?tid=46944&highlight=read%7Cwab

The path of the Windows Address Book (wab) file used by Outlook Express can be found in the registry at: HKEY_CURRENT_USER/Software/Microsoft/WAB/WAB4/Wab File Name.

Here's what I've managed to figure out about the wab file format, looking at it with a hex editor (first byte of the file is byte zero).

Byte #:
32-35 ($20-$23) - Location (Address) in the file of the start of the table that tells where the information for each contact is located (I'll refer to it as the Contact Data Table).
36 ($24) - Number of entries in the Contact Data Table.
48-51 ($30-$33) - Location in the file of the list of Display Names for the persons (contacts) in the address book.
52 ($34) - Number of Display Names in the file
64-67 ($40-$43) - Location in the file of the list of Last Names for the contacts.
68 ($44) - Number of Last Names in the file.
80-83 ($50-$53) - Location in the file of the list of First Names for the contacts.
84 ($54) - Number of First Names in the file.
96-99 ($60-$63) - Location in the file of the list of E-Mail Addresses.
100 ($64) - Number of E-Mail Addresses in the file.

In you're trying to read the file in binary mode using VB, you'll need to add one each to each of the values above, since VB considers the first byte of a file to be byte one, not byte zero.

Format of the Contact Data Table (location as specified above):
Each entry in this table occupies 8 bytes. The first four bytes of each entry are what we'll call the Contact Index, a value that uniqely identifies each contact in the address book. The 5th through 8th bytes are the location (address) in the file where the Contact Data Record (Home Address, Home Phone, Work Phone, etc.) can be found. The exact format of the Contact Data Record is not something I've figured out yet.

Format of the other lists above (Display Name, Last Name, First Name, and E-Mail Address):
Each entry in one of these lists occupies 68 bytes. The bytes are stored as Unicode, meaning there are two bytes for each character, with the upper byte being zero (at least in English language versions of Windows). By reading every other byte, you can get the ASCII values that represent each character in an entry in the list. When you come to a byte pair where the lower order byte is zero, you've reached the end of the text for that entry. The 65th to 68th bytes of each entry are the Contact Index. By matching up Contact Index values between lists, you can tell which entry in one list goes with an entry in another (i.e., which Display Name belongs with which E-Mail Address). You can also match the Contact Index in these lists to the one in the Contact Data Table to determine where the rest of the contact's information is located in the file.

Recent versions of Outlook Express allow you to store multiple address books (or the address book for multiple Outlook Express identities) in one wab file. I haven't yet figured out how to separate the data by identity. Using the information above, you'll end up getting the data for every contact that exists in the file, regardless of what address book or identity it belongs to.

I have a VB6 project (MAPIMail) that uses what I've found out about the wab file to read the Display Names and E-Mail Addresses for each contact. It also uses the Microsoft MAPI Controls (MAPISession and MAPIMessages) to create an e-mail client that allows you to read and send e-mails, as well.

Since I haven't yet figured out the entire format of the Contact Data Record, I can't get at information like addresses and phone numbers by reading them directly from the wab file. The only way I've figured out to get this information is using another VB6 project I've created (AddrBook.vbp) that opens Microsoft's Address Book reader (wab.exe), then uses API calls to force it to export the address book as a comma-separated-value (.csv) file. My program then reads this file and displays the information in a ListView. A hokey method of getting at the data, I'll admit, but the best I've been able to do, so far.

My programs were tested on a computer running Windows 2000 SP4 with Outlook Express 6.

唉。。实际上,这些数据都可以通过微软的API获取,但是其他信息,如公司、电话、家庭等等的格式就比较混乱了,基本上都是在文件尾部,但是到底从什么位置开始,还找不到规律。。。
另外,地址本每次修改都会做一次备份操作,这个机制倒是研究出来了。。

0x8A8处记录了文件尾部有效数据的开始地址

位图(bmp)文件格式分析

位图(bmp)文件格式分析 作者:深蓝(由博主分享) 一、什么是位图 计算机能以位图和矢量图格式显示图像。 1、位图(Bitmap): 图像又称点阵图或光栅图,它使用我们称为像素(象素,Pi...
  • qingchuwudi
  • qingchuwudi
  • 2014年05月14日 11:42
  • 3245

Linux/Unix平台可执行文件格式分析

本文讨论了 UNIX/LINUX 平台下三种主要的可执行文件格式:a.out(assembler and link editor output 汇编器和链接编辑器的输出)、COFF(Common Ob...
  • chengfangang
  • chengfangang
  • 2013年08月13日 11:59
  • 1392

MJPEG格式和码流分析

JFIF 是 JPEG File Interchange Format 的缩写,也即 JPEG 文件交换格式。JFIF 是一个图片文件格式标准,它是一种使用 JPEG 图像压缩技术存储摄影图像的方法。...
  • ASKLW
  • ASKLW
  • 2017年05月21日 10:08
  • 445

tar文件格式分析

导火索,在对打包后的数据进行MD5jiao yan
  • agony000
  • agony000
  • 2014年09月16日 19:19
  • 861

wav文件格式分析详解

一、综述     WAVE文件作为多媒体中使用的声波文件格式之一,它是以RIFF格式为标准的。 RIFF是英文Resource Interchange File Format的缩写,每个WAVE文...
  • zeping891103
  • zeping891103
  • 2017年11月30日 14:34
  • 30

JPEG文件格式简单分析

一,JPEG文件格式概述:       图像和动画的存储方式是一个很重要的问题。幸好我们有了数据压缩,有了JPEG等多种压缩存储图像的文件格式。如果没有图像压缩算法,也许我们的多媒体时代就会...
  • andylauren
  • andylauren
  • 2016年08月20日 09:41
  • 362

tcpdump文件格式分析

tcpdump命令是linux下很常用的抓包命令。使用-w选项可以把抓包的数据记录到文件。那么这个文件的格式是什么样的呢?首先我们抓几个包试试 tcpdump -w test.dump -c 5 ...
  • u014497084
  • u014497084
  • 2016年02月18日 11:29
  • 1451

avi文件格式解析

结合avi视频文件头十六进制码分析AVI格式   这段时间要搞视频合成方面的东西,因此打算先弄明白avi视频的格式,介绍这方面内容的东西google一下一大堆,可是很悲剧,现在的人基本上都喜欢...
  • occupy8
  • occupy8
  • 2014年11月01日 11:07
  • 1244

Web控件和HTML控件的不同之处

在将ASP.Net的时候,讲到了Web 控件和HTMl控件,在VS2012中的工具一栏中也有明显的分类,Web控件和Html控件,两者的不同之处在哪里呢? 第一:相识,相知 Html控件:  ...
  • u010196821
  • u010196821
  • 2014年11月16日 14:04
  • 2063

戏说CAD开发 DWG文件格式浅析

可恶的AutoDESK用自己的操作方式和格式一同天下,据统计世界上有70%的图纸是dwg格式的。所以大家都不得不去琢磨这个dwg,如果那个公司说要推出自己的格式抗衡dwg,你就全当他在说梦话吧。毕竟林...
  • godwiser
  • godwiser
  • 2013年01月12日 09:24
  • 1549
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:wab文件格式分析
举报原因:
原因补充:

(最多只允许输入30个字)