@@ -83,31 +83,28 @@ public class OneOffEntry {
83
83
public String addressType = "" ;
84
84
public String emailAddress = "" ;
85
85
int pos = 0 ;
86
+ public String toString () {
87
+ return String .format (
88
+ "Display Name: %s\n " +
89
+ "Address Type: %s\n " +
90
+ "Email Address: %s\n " ,
91
+ this .displayName ,
92
+ this .addressType ,
93
+ this .emailAddress );
94
+ }
86
95
}
87
96
88
97
private OneOffEntry parseOneOffEntry (byte [] data , int pos )
89
98
throws IOException
90
99
{
91
- /*
92
- dd01 0f54 0200 0001 8064 0069 0073 0074 Ý..T.....d.i.s.t
93
- 0020 006e 0061 006d 0065 0020 0032 0000 ...n.a.m.e...2..
94
- 0053 004d 0054 0050 0000 0064 0069 0073 .S.M.T.P...d.i.s
95
- 0074 0032 0040 0072 006a 006f 0068 006e .t.2...r.j.o.h.n
96
- 0073 006f 006e 002e 0069 0064 002e 0061 .s.o.n...i.d...a
97
- 0075 0000 00 .u...
98
- */
99
100
int version = (int )PSTObject .convertLittleEndianBytesToLong (data , pos , pos +2 );
100
- //System.out.println("Version: "+version);
101
101
pos += 2 ;
102
102
103
103
// http://msdn.microsoft.com/en-us/library/ee202811(v=exchg.80).aspx
104
104
int additionalFlags = (int )PSTObject .convertLittleEndianBytesToLong (data , pos , pos +2 );
105
- //PSTObject.printFormattedNumber("Additional flags: ",additionalFlags);
106
105
pos += 2 ;
107
106
108
- //PSTObject.printFormattedNumber("flag: ",0x800);
109
107
int pad = additionalFlags & 0x8000 ;
110
- //PSTObject.printFormattedNumber("Pad: ",pad);
111
108
int mae = additionalFlags & 0x0C00 ;
112
109
int format = additionalFlags & 0x1E00 ;
113
110
int m = additionalFlags & 0x0100 ;
@@ -121,21 +118,18 @@ private OneOffEntry parseOneOffEntry(byte[] data, int pos)
121
118
byte [] displayNameBytes = new byte [stringEnd - pos ];
122
119
System .arraycopy (data , pos , displayNameBytes , 0 , displayNameBytes .length );
123
120
String displayName = new String (displayNameBytes , "UTF-16LE" );
124
- //System.out.println("displayName: "+displayName);
125
121
pos = stringEnd + 2 ;
126
122
127
123
stringEnd = findNextNullChar (data , pos );
128
124
byte [] addressTypeBytes = new byte [stringEnd - pos ];
129
125
System .arraycopy (data , pos , addressTypeBytes , 0 , addressTypeBytes .length );
130
126
String addressType = new String (addressTypeBytes , "UTF-16LE" );
131
- //System.out.println("addressType "+addressType);
132
127
pos = stringEnd + 2 ;
133
128
134
129
stringEnd = findNextNullChar (data , pos );
135
130
byte [] emailAddressBytes = new byte [stringEnd - pos ];
136
131
System .arraycopy (data , pos , emailAddressBytes , 0 , emailAddressBytes .length );
137
132
String emailAddress = new String (emailAddressBytes , "UTF-16LE" );
138
- //System.out.println("emailAddress "+emailAddress);
139
133
pos = stringEnd + 2 ;
140
134
141
135
OneOffEntry out = new OneOffEntry ();
@@ -146,82 +140,56 @@ private OneOffEntry parseOneOffEntry(byte[] data, int pos)
146
140
return out ;
147
141
}
148
142
149
- public String [] getDistributionListMembers ()
143
+ public Object [] getDistributionListMembers ()
150
144
throws PSTException , IOException
151
145
{
152
- //PidLidDistributionListMembers
153
- // this looks like a Recipeint One-Off EntryID Structure
154
146
PSTTableBCItem item = this .items .get (pstFile .getNameToIdMapItem (0x8055 , PSTFile .PSETID_Address ));
155
- //item = this.items.get(0x8047);
156
- String [] out = {};
147
+ Object [] out = {};
157
148
if (item != null ) {
158
- PSTObject .printHexFormatted (item .data , true );
159
-
160
149
int pos = 0 ;
161
-
162
150
int count = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +4 );
163
- //System.out.println("Count: "+ count) ;
151
+ out = new Object [ count ] ;
164
152
pos += 4 ;
165
153
pos = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +4 );
166
- //System.out.println("pos: "+pos);
167
154
168
- while (pos < item .data .length ) {
169
- /*
170
- 00 0000 00
171
- 81 2b1f a4be a310 199d 6e00 dd01 0f54
172
- */
155
+ for (int x = 0 ; x < count ; x ++) {
173
156
// http://msdn.microsoft.com/en-us/library/ee218661(v=exchg.80).aspx
174
157
// http://msdn.microsoft.com/en-us/library/ee200559(v=exchg.80).aspx
175
158
int flags = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +4 );
176
159
pos += 4 ;
177
160
178
161
byte [] guid = new byte [16 ];
179
162
System .arraycopy (item .data , pos , guid , 0 , guid .length );
180
- //PSTObject.printHexFormatted(guid, true);
181
- //System.out.println(Arrays.equals(guid, wrappedEntryIdUid));
182
163
pos += 16 ;
183
164
184
165
if (Arrays .equals (guid , wrappedEntryIdUid )) {
185
- //System.out.println("Wrapped entry");
186
-
187
166
/* c3 */
188
167
int entryType = item .data [pos ] & 0x0F ;
189
168
int entryAddressType = item .data [pos ] & 0x70 >> 4 ;
190
169
boolean isOneOffEntryId = (item .data [pos ] & 0x80 ) > 0 ;
191
170
pos ++;
192
- if (entryType == 3 ) {
193
- /*
194
- 00 0000 00
195
- a4 1d63 dbc5 3b8e 4ab8 071e <- some guid from some where.
196
- 15e5 5750 ce
197
- 64 00 20 00
198
- */
199
- int wrappedflags = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +4 );
200
- pos += 4 ;
171
+ int wrappedflags = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +4 );
172
+ pos += 4 ;
201
173
202
- byte [] guid2 = new byte [16 ];
203
- System .arraycopy (item .data , pos , guid , 0 , guid .length );
204
- //PSTObject.printHexFormatted(guid, true);
205
- pos += 16 ;
174
+ byte [] guid2 = new byte [16 ];
175
+ System .arraycopy (item .data , pos , guid , 0 , guid .length );
176
+ pos += 16 ;
206
177
207
- int descriptorId = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +3 );
208
- pos += 3 ;
178
+ int descriptorIndex = (int )PSTObject .convertLittleEndianBytesToLong (item .data , pos , pos +3 );
179
+ pos += 3 ;
209
180
210
- byte empty = item .data [pos ];
211
- pos ++;
181
+ byte empty = item .data [pos ];
182
+ pos ++;
212
183
213
- }
184
+ out [ x ] = PSTObject . detectAndLoadPSTObject ( this . pstFile , descriptorIndex );
214
185
215
186
} else if (Arrays .equals (guid , oneOffEntryIdUid )) {
216
187
OneOffEntry entry = parseOneOffEntry (item .data , pos );
217
- System .out .println (entry .emailAddress );
218
188
pos = entry .pos ;
189
+ out [x ] = entry ;
219
190
}
220
-
221
191
}
222
192
}
223
193
return out ;
224
194
}
225
-
226
-
227
195
}
0 commit comments