Well, I worked out enough to get the data I need!
I'll keep the document on my website, but here it is, just so it's somewhere
http://www.bloodyeck.com/projects/audrey/AddressDB.format.txt
I'm going to make ACID look up phone numbers in the palm addressbooks
(both audrey and the palm pilot I sync) but to do this I need to work
out the format of AddressDB.gdbm
I've already been able to open it as a gdbm file, the keys all appear
to be just numbers and the data is where the real info is. however it
is encoded and I needed to work out how to get the data out. Below are
my findings.
first byte is either 0 or 1
There is only one entry starting with 0 and this contains all your category
names and custom field names. See below for the format of this entry
If you imagine the following bytes as being numbered from a thu z then
it's easy to follow this....
normal entries start with the first byte being 1 followed by:
a-e 5 bytes record number - first thee bytes (a-c) all zero on my DB,
appears to be uniq
f-h 3 bytes also looks like a record number but is not uniq, first two
bytes (f-g) all zero on my DB
i 1 byte that is usually 0,80 or 83
j 1 byte that is either 0 or fd
k-l 2 bytes that look like an entry number (but not uniq)
m 1 bytes that is always zero
n 1 byte that is only 1 for my address entry..???
o 1 byte of some random use...
p 1 byte that is usually 0 or 10
q 1 byte indicating the category this entry is in (you know
work/personal/etc..) this indexes into the array created
from the entry starting with 0 (see below)
r 1 byte possibly what the refresh status is? it's either 0 or e7
s 1 byte 1st 4 bits are the default 'number' to display in the summary listing
2nd 4 bits (least significant) what type is the 5th phone entry
See notes below on 4 bit numbers.
t 1 byte 1st 4 bits what type is the 4th phone number
2nd 3 bits what type is the 3rd phone number
u 1 byte 1st 4 bits what type is the 2nd phone number
2nd 3 bits what type is the 1st phone number
v 1 byte that is always zero
w 1 byte 3 bits (least significant) indicating the if the custom3
custom4 and note values are present at the end of the entry
x 1 byte 8 bits indicating presence of data headers 8 to 15
y 1 byte 8 bits indicating presence of data headers 0 to 15
header 0 is represented by the least significant bit
z 1 byte usually 0 but not always (use unknown)
then for each of the 21 bits that are 1 in the w,x and y bytes there
will be a null terminated string representing that value. Starting
with Header 0 (lastname) all the way down to note (header 18).
format of the category names
after the initial 0 identifying it as a category entry there are...
9 bytes: unknown usage
15 sets of 16 bytes containing the category names (zero padded at the end);
24 bytes: unknown usage
21 sets of 16 bytes containing the address book header names (zero padded)
4 bytes: unknown usage
the address book header names are in this order
Header 0: Last name bit 1 of byte y
Header 1: First name bit 2 of byte y
Header 2: Company
Header 3: Work bit 4
Header 4: Home bit 5
Header 5: Fax bit 6 (but not always fax, see 4 bit numbers note)
Header 6: Other
Header 7: E-mail bit 8
Header 8: Address bit 1 of byte x
Header 9: City bit 2
Header 10: State
Header 11: Zip Code
Header 12: Country
Header 13: Title
Header 14: Custom 1
Header 15: Custom 2 bit 8 of byte x
Header 16: Custom 3 bit 1 of byte w
Header 17: Custom 4 bit 2
Header 18: Note bit 3
Header 19: Main
Header 20: Pager
Header 21: Mobile
If you have modified Custom 1 to be "Birthday" then that will be
displayed for header 14 and so forth.
4 bit numbers note:
note that for each phone number or email that you can enter, you can
choose what type each category is, that means that the first catgeory
wont always have the work number in it. For each of the 5 entries, the
type of the data in that entry is determined by a 4 bit number (in 4
bits you can represent a number between 1 and 15) here are the values
for each of those numbers
0=work
1=home
2=fax
3=other
4=email
5=main
6=pager
7=mobile
Reverse Engineered by Alex Knowes (alex AT bloodyeck,com) April 26th 2002
If you work out any of the missing codes/bytes, please drop me an email
http://www.bloodyeck.com/projects/audrey/