-
Notifications
You must be signed in to change notification settings - Fork 0
/
outlook2.pl
513 lines (459 loc) · 21 KB
/
outlook2.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
#------------------------------------------------------------------------------
# outlook2.pl
# A step in the swampy MAPI
# Plugin for RegRipper
#
# Change history
# 20130308 created
# 20130315 completed
#
# References
# [1] http://www.windowsitpro.com/article/registry2/inside-mapi-profiles-45347
# [2] http://msdn.microsoft.com/en-us/library/ms526356(v=exchg.10).aspx
# [3] http://msdn.microsoft.com/en-us/library/ms526844%28v=exchg.10%29.aspx
# [4] http://www.dimastr.com/redemption/enum_MAPITags.htm
# [5] http://www.howto-outlook.com/howto/clearmru.htm
#
# Todo
# Correlate with the exchange keys
# Correlate with the Outlook catalog key
#
# copyright 2013 Realitynet System Solutions snc
# author: francesco picasso <[email protected]>
#------------------------------------------------------------------------------
package outlook2;
use strict;
use Parse::Win32Registry qw( unpack_windows_time
unpack_unicode_string
unpack_sid
unpack_ace
unpack_acl
unpack_security_descriptor );
my %config = (hive => "NTUSER\.DAT",
hasShortDescr => 1,
hasDescr => 0,
hasRefs => 1,
osmask => 22,
version => 20130315);
sub getConfig{return %config}
sub getShortDescr {
return "Gets MAPI (Outlook) settings";
}
sub getDescr{}
sub getRefs {
my %refs = (
"Kevin Laahs - Inside MAPI Profiles" =>
"http://www.windowsitpro.com/article/registry2/inside-mapi-profiles-45347",
"MAPI Property Tags" =>
"http://technet.microsoft.com/en-us/library/cc736412%28v=ws.10%29.aspx",
"Microsoft Exchange Property Tags" =>
"http://msdn.microsoft.com/en-us/library/ms526844%28v=exchg.10%29.aspx",
"Outlook Redemption MAPI Tags" =>
"http://www.dimastr.com/redemption/enum_MAPITags.htm",
"Clear the Most Recently Used lists" =>
"http://www.howto-outlook.com/howto/clearmru.htm"
);
}
sub getHive {return $config{hive};}
sub getVersion {return $config{version};}
my $VERSION = getVersion();
my %outlook_subkeys;
sub pluginmain {
my $class = shift;
my $ntuser = shift;
::logMsg("Launching outlook2 v.".$VERSION);
::rptMsg("outlook2 v.".$VERSION);
::rptMsg("(".getHive().") ".getShortDescr()."\n");
my $reg = Parse::Win32Registry->new($ntuser);
my $root_key = $reg->get_root_key;
my $tab;
my $key;
my $key_path;
my $outlook_key_path = 'Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows Messaging Subsystem\\Profiles\\Outlook';
my $accounts_key_name = '9375CFF0413111d3B88A00104B2A6676';
::rptMsg("Working path is '$outlook_key_path'");
::rptMsg("");
$key = $root_key->get_subkey($outlook_key_path);
if (!$key) { ::rptMsg("Outlook key not found"); return; }
my @subkeys = $key->get_list_of_subkeys();
foreach my $s (@subkeys) { $outlook_subkeys{$s->get_name()} = $s; }
# Accessing ACCOUNTS
# This is the real "entry" point of the plugin
# "Another well-known GUID is 9375CFF0413111d3B88A00104B2A6676, which is
# used to hold details about all the accounts that are in use within the
# profile. Under this subkey, you will find a subkey per account.
# For example, you'll typically find a subkey relating to the Outlook
# Address Book (OAB) account, the Exchange account, an account for each PST
# file that's been added to the profile, and any POP3/IMAP mail accounts
# that are defined within the profile." Ref[1]
$key_path = $outlook_key_path.'\\'.$accounts_key_name;
$key = $root_key->get_subkey($key_path);
if (!$key) { ::rptMsg("Accounts key '$accounts_key_name' not found"); return; }
::rptMsg("__key_ $accounts_key_name");
::rptMsg("_time_ ".gmtime($key->get_timestamp()));
::rptMsg("_desc_ accounts used within the profile");
::rptMsg("");
delete($outlook_subkeys{$accounts_key_name});
my @accounts_keys = $key->get_list_of_subkeys();
foreach my $account_key (@accounts_keys)
{
$tab = ' ';
::rptMsg($tab.'---------------------------------------');
::rptMsg($tab.$account_key->get_name()." [".gmtime($account_key->get_timestamp())." UTC]");
::rptMsg($tab.'---------------------------------------');
::rptMsg($tab.get_unicode_string($account_key, 'Account Name'));
::rptMsg($tab.get_dword_string_long($account_key, 'MAPI provider'));
::rptMsg($tab.get_dword_string($account_key, 'Mini UID'));
::rptMsg($tab.get_unicode_string($account_key, 'Service Name'));
::rptMsg($tab.get_hex_string($account_key, 'Service UID'));
my $service_id_key_name = $account_key->get_value('Service UID');
if (!$service_id_key_name) { ::rptMsg(""); next; }
::rptMsg($tab.'\\');
$tab = ' ';
parse_service($root_key, $outlook_key_path, $service_id_key_name, $tab);
$tab = ' ';
::rptMsg($tab.'/');
::rptMsg($tab.get_dword_string($account_key, 'XP Status'));
::rptMsg($tab.get_hex_string($account_key, 'XP Provider UID'));
my $xp_id_key_name = $account_key->get_value('XP Provider UID');
if (!$xp_id_key_name) { ::rptMsg(""); next; }
::rptMsg($tab.'\\');
$tab = ' ';
parse_xp_service($root_key, $outlook_key_path, $xp_id_key_name, $tab);
$tab = ' ';
::rptMsg($tab.'/');
::rptMsg("");
}
# Global Profile Section
$tab = '';
::rptMsg("");
my $global_profile_key_name = '13dbb0c8aa05101a9bb000aa002fc45a';
$key_path = $outlook_key_path.'\\'.$global_profile_key_name;
my $global_profile_key = $root_key->get_subkey($key_path);
if (!$global_profile_key) { ::rptMsg("Global profile key not found!"); }
else
{
delete($outlook_subkeys{$global_profile_key_name});
::rptMsg("__key_ $global_profile_key_name");
::rptMsg("_time_ ".gmtime($global_profile_key->get_timestamp()));
::rptMsg("_desc_ global profile section (data related to Profile)");
::rptMsg("");
$tab = ' ';
::rptMsg( $tab.get_hex_string($global_profile_key, '00036600', 'Profile Version'));
::rptMsg( $tab.get_hex_string($global_profile_key, '00036601', 'Config Flags'));
::rptMsg( $tab.get_hex_string($global_profile_key, '00036604', 'Connect Flags'));
::rptMsg( $tab.get_hex_string($global_profile_key, '00036605', 'Transport Flags'));
::rptMsg( $tab.get_hex_string($global_profile_key, '00036606', 'UI State'));
::rptMsg( $tab.get_hex_string($global_profile_key, '00036619', 'Auth Package'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e6603', 'User'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e6602', 'Home Server'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e6608', 'Unresolved Server'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e6612', 'Home Server DN'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f662a', 'Internet Content'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e667c', 'MOAB GUID'));
::rptMsg( $tab.get_ascii_string($global_profile_key, '001e6750', '*UNKNOWN*'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f3001', 'Display Name'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f6607', 'Unresolved Name'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f6610', 'OST Path'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f6620', '*UNKNOWN*'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f663d', '*UNKNOWN*'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f6641', '*UNKNOWN*'));
::rptMsg($tab.get_unicode_string($global_profile_key, '001f667b', '*UNKNOWN*'));
::rptMsg( $tab.get_windows_time($global_profile_key, '004067e2', 'Transmission time'));
::rptMsg( $tab.get_windows_time($global_profile_key, '00146686', 'Address timestamp'));
::rptMsg( $tab.get_windows_time($global_profile_key, '00406642', 'Oldest deleted'));
::rptMsg( $tab.get_windows_time($global_profile_key, '00406638', '*UNKNOWN* time'));
::rptMsg( $tab.get_windows_time($global_profile_key, '004065ed', '*UNKNOWN* time'));
::rptMsg( $tab.get_windows_time($global_profile_key, '00406628', '*UNKNOWN* time'));
::rptMsg( $tab.get_hex_string($global_profile_key, '01023d00', 'Store Providers'));
my $provider_id_key_name = $global_profile_key->get_value('01023d00');
if (!$provider_id_key_name) { return; }
::rptMsg($tab.'\\');
$tab = ' ';
parse_provider($root_key, $outlook_key_path, $provider_id_key_name, $tab);
$tab = ' ';
::rptMsg($tab.'/');
::rptMsg( $tab.get_hex_string($global_profile_key, '01023d01', 'AB Providers'));
my $ab_provider_id_key_name = $global_profile_key->get_value('01023d01');
if (!$ab_provider_id_key_name) { return; }
::rptMsg($tab.'\\');
$tab = ' ';
parse_provider($root_key, $outlook_key_path, $ab_provider_id_key_name, $tab, 'ab');
$tab = ' ';
::rptMsg($tab.'/');
::rptMsg( $tab.get_hex_string($global_profile_key, '01023d02', 'Transport Providers'));
::rptMsg( $tab.get_hex_string($global_profile_key, '01023d0c', 'Service UID'));
}
# MUID_PROFILE_INSTANCE
# Well known section in a profile which contains a property (PR_SEARCH_KEY) which is unique
# for any given profile. Applications and providers can depend on this value as being
# different for each unique profile. */
::rptMsg("\n");
my $muid_profile_instance_key_name = '8503020000000000c000000000000046';
$key_path = $outlook_key_path.'\\'.$muid_profile_instance_key_name;
my $muid_profile_instance_key = $root_key->get_subkey($key_path);
if (!$muid_profile_instance_key) { ::rptMsg("MUID profile key not found!"); }
else
{
delete($outlook_subkeys{$muid_profile_instance_key_name});
::rptMsg("__key_ $muid_profile_instance_key_name");
::rptMsg("_time_ ".gmtime($muid_profile_instance_key->get_timestamp()));
::rptMsg("_desc_ MUID profile section");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
# MUIDEMSAB profile section
::rptMsg("\n");
my $muidemsab_profile_key_name = 'dca740c8c042101ab4b908002b2fe182';
$key_path = $outlook_key_path.'\\'.$muidemsab_profile_key_name;
my $muidemsab_profile_key = $root_key->get_subkey($key_path);
if (!$muidemsab_profile_key) { ::rptMsg("MUIDEMSAB key not found!"); }
else
{
delete($outlook_subkeys{$muidemsab_profile_key_name});
::rptMsg("__key_ $muidemsab_profile_key_name");
::rptMsg("_time_ ".gmtime($muidemsab_profile_key->get_timestamp()));
::rptMsg("_desc_ MUIDEMSAB section");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
# [Dialup Networking]
# SectionGUID=5acf76a3665511cea39a00aa004acafa
# DialConnection=PT_BOOLEAN,0x6717
#; -- A boolean value indicating whether to dial the Exchange
#; server or use the existing connection.
#; If set to TRUE, Outlook will dial using the RAS profile choosen.
#; If FALSE, Outlook will use the existing connection.
# DomainName=PT_STRING8,0x67f0
# Password=PT_BINARY,0x67f1
# UserName=PT_STRING8,0x67f2
# ConnectionName=PT_STRING8,0x6710
::rptMsg("\n");
my $dialup_networking_key_name = '5acf76a3665511cea39a00aa004acafa';
$key_path = $outlook_key_path.'\\'.$dialup_networking_key_name;
my $dialup_networking_key = $root_key->get_subkey($key_path);
if (!$dialup_networking_key) { ::rptMsg("Dialup Networking key not found!"); }
else
{
delete($outlook_subkeys{$dialup_networking_key_name});
::rptMsg("__key_ $dialup_networking_key_name");
::rptMsg("_time_ ".gmtime($dialup_networking_key->get_timestamp()));
::rptMsg("_desc_ DialUp Networking section");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
# todo 42acdf40ca5b11cdb7ba00aa003cf7f1
::rptMsg("\n");
my $unknown_key_name = '42acdf40ca5b11cdb7ba00aa003cf7f1';
$key_path = $outlook_key_path.'\\'.$unknown_key_name;
my $unknown_key = $root_key->get_subkey($key_path);
if (!$unknown_key) { ::rptMsg("key '$unknown_key_name' not found!"); }
else
{
delete($outlook_subkeys{$unknown_key_name});
::rptMsg("__key_ $unknown_key_name");
::rptMsg("_time_ ".gmtime($unknown_key->get_timestamp()));
::rptMsg("_desc_ no description available");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
# todo 9207f3e0a3b11019908b08002b2a56c2
::rptMsg("\n");
my $unknown2_key_name = '9207f3e0a3b11019908b08002b2a56c2';
$key_path = $outlook_key_path.'\\'.$unknown2_key_name;
my $unknown2_key = $root_key->get_subkey($key_path);
if (!$unknown2_key) { ::rptMsg("key '$unknown2_key_name' not found!"); }
else
{
delete($outlook_subkeys{$unknown2_key_name});
::rptMsg("__key_ $unknown2_key_name");
::rptMsg("_time_ ".gmtime($unknown2_key->get_timestamp()));
::rptMsg("_desc_ no description available");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
# Outlook settings and artifacts
::rptMsg("\n");
my $outlook_key_name = '0a0d020000000000c000000000000046';
$key_path = $outlook_key_path.'\\'.$outlook_key_name;
my $outlook_key = $root_key->get_subkey($key_path);
if (!$outlook_key) { ::rptMsg("Outlook key not found!"); }
else
{
delete($outlook_subkeys{$outlook_key_name});
::rptMsg("__key_ $outlook_key_name");
::rptMsg("_time_ ".gmtime($outlook_key->get_timestamp()));
::rptMsg("_desc_ settings and artifacts related to Outlook");
::rptMsg('');
::rptMsg(' *** TODO ***');
}
$tab = '';
::rptMsg("\n");
::rptMsg("Outlook subkeys not direclty linked (WARNING: PARTIAL, plugin not complete!");
foreach my $okey_name (keys %outlook_subkeys)
{
::rptMsg($tab."$okey_name");
}
}
sub parse_service
{
my $root_key = shift;
my $outlook_key_path = shift;
my $ids = shift;
my $tab = shift;
$ids = $ids->get_raw_data();
my $num_of_ids = length($ids) / 16;
# Never seen more than one, contact author.
if ($num_of_ids > 1) { ::rptMsg($tab."WARNING: expected only 1 Service ID, found $num_of_ids");}
my $service_id_key_name = join('', unpack('(H2)16', $ids));
my $service_id_key = $root_key->get_subkey($outlook_key_path.'\\'.$service_id_key_name);
if (!$service_id_key) { ::rptMsg($tab.'WARNING: Service UID not found in Outlook path!'); return; }
::rptMsg($tab.$service_id_key_name.' ['.gmtime($service_id_key->get_timestamp()).' UTC]');
::rptMsg($tab.'--------------------------------');
delete($outlook_subkeys{$service_id_key_name});
::rptMsg($tab.get_unicode_string($service_id_key, '001f3001', 'Display Name'));
::rptMsg($tab.get_unicode_string($service_id_key, '001f3d0a', 'Service DLL Name'));
::rptMsg($tab.get_unicode_string($service_id_key, '001f3d0b', 'DLL Entry Point'));
::rptMsg($tab.get_hex_string($service_id_key, '01023d00', 'Store provider'));
my $provider_id_key_name = $service_id_key->get_value('01023d00');
if (!$provider_id_key_name) { return; }
::rptMsg($tab.'\\');
$tab = ' ';
parse_provider($root_key, $outlook_key_path, $provider_id_key_name, $tab);
$tab = ' ';
::rptMsg($tab.'/');
}
sub parse_provider
{
my $root_key = shift;
my $outlook_key_path = shift;
my $ids = shift;
my $tab = shift;
my $type = shift; # if defined means AB
$ids = $ids->get_raw_data();
my $num_of_ids = length($ids) / 16;
for (my $i = 0; $i < $num_of_ids; $i += 1)
{
my $provider_id_key_name = join('', unpack('(H2)16', $ids));
$ids = substr($ids, 16);
my $provider_id_key = $root_key->get_subkey($outlook_key_path.'\\'.$provider_id_key_name);
if (!$provider_id_key)
{
::rptMsg($tab.'WARNING: Provider ID not found in Outlook path!');
if (($i+1) != $num_of_ids) { ::rptMsg($tab.'+'); }
next;
}
::rptMsg($tab.$provider_id_key_name.' ['.gmtime($provider_id_key->get_timestamp()).' UTC]');
::rptMsg($tab.'--------------------------------');
delete($outlook_subkeys{$provider_id_key_name});
::rptMsg($tab.get_unicode_string($provider_id_key, '001f3001', 'Display Name'));
::rptMsg($tab.get_unicode_string($provider_id_key, '001f3006', 'Provider Display'));
::rptMsg($tab.get_unicode_string($provider_id_key, '001f300a', 'Provider DLL Name'));
::rptMsg($tab.get_unicode_string($provider_id_key, '001f3d09', 'Service Name'));
::rptMsg( $tab.get_hex_string($provider_id_key, '01023d0c', 'Service UID'));
if ($type)
{
}
else
{
::rptMsg($tab.get_ascii_string($provider_id_key, '001e660b', 'Profile Mailbox'));
::rptMsg($tab.get_ascii_string($provider_id_key, '001e660c', 'Profile Server'));
::rptMsg($tab.get_ascii_string($provider_id_key, '001e6614', 'Profile Server DN'));
::rptMsg($tab.get_unicode_string($provider_id_key, '001f6700', 'PST Path'));
}
if (($i+1) != $num_of_ids) { ::rptMsg($tab.'+'); }
}
}
sub parse_xp_service
{
my $root_key = shift;
my $outlook_key_path = shift;
my $ids = shift;
my $tab = shift;
$ids = $ids->get_raw_data();
my $num_of_ids = length($ids) / 16;
for (my $i = 0; $i < $num_of_ids; $i += 1)
{
my $service_id_key_name = join('', unpack('(H2)16', $ids));
$ids = substr($ids, 16);
my $service_id_key = $root_key->get_subkey($outlook_key_path.'\\'.$service_id_key_name);
if (!$service_id_key)
{
::rptMsg($tab.'WARNING: XP Service UID not found in Outlook path!');
if (($i+1) != $num_of_ids) { ::rptMsg($tab.'+'); }
next;
}
::rptMsg($tab.$service_id_key_name.' ['.gmtime($service_id_key->get_timestamp()).' UTC]');
::rptMsg($tab.'--------------------------------');
delete($outlook_subkeys{$service_id_key_name});
::rptMsg($tab.get_ascii_string($service_id_key, '001e660b', 'User'));
::rptMsg($tab.get_ascii_string($service_id_key, '001e6614', 'Server'));
::rptMsg($tab.get_ascii_string($service_id_key, '001e660c', 'Server Name'));
::rptMsg($tab.get_unicode_string($service_id_key, '001f3001', 'Display Name'));
::rptMsg($tab.get_unicode_string($service_id_key, '001f3006', 'Provider Display'));
::rptMsg($tab.get_unicode_string($service_id_key, '001f300a', 'Provider DLL Name'));
if (($i+1) != $num_of_ids) { ::rptMsg($tab.'+'); }
}
}
sub get_windows_time
{
my $key = shift;
my $value = shift;
my $value_desc = shift;
my $data = $key->get_value($value);
if ($data) { $data = gmtime(unpack_windows_time($data->get_raw_data())).' UTC';}
else { $data = '<no value>'; }
if (!$value_desc) { return sprintf("%-24s %s", $value.':', $data); }
return sprintf("%s %-24s %s", $value, '['.$value_desc.']:', $data);
}
sub get_hex_string
{
my $key = shift;
my $value = shift;
my $value_desc = shift;
my $data = $key->get_value($value);
if ($data) { $data = join('', unpack('(H2)*', $data->get_raw_data()));}
else { $data = '<no value>'; }
if (!$value_desc) { return sprintf("%-24s %s", $value.':', $data); }
return sprintf("%s %-24s %s", $value, '['.$value_desc.']:', $data);
}
sub get_dword_string
{
my $key = shift;
my $value = shift;
my $data = $key->get_value($value);
if ($data) { $data = $data->get_data(); $data = sprintf('0x%08X', $data); }
else { $data = '<no value>'; }
return sprintf("%-24s %s", $value.':', $data);
}
sub get_dword_string_long
{
my $key = shift;
my $value = shift;
my $data = $key->get_value($value);
if ($data) { $data = $data->get_data(); $data = sprintf('%u [0x%08X]', $data, $data); }
else { $data = '<no value>'; }
return sprintf("%-24s %s", $value.':', $data);
}
sub get_unicode_string
{
my $key = shift;
my $value = shift;
my $value_desc = shift;
my $data = $key->get_value($value);
if ($data) { $data = unpack_unicode_string($data->get_data()); }
else { $data = '<no value>'; }
if (!$value_desc) { return sprintf("%-24s %s", $value.':', $data); }
return sprintf("%s %-24s %s", $value, '['.$value_desc.']:', $data);
}
sub get_ascii_string
{
my $key = shift;
my $value = shift;
my $value_desc = shift;
my $data = $key->get_value($value);
if ($data) { $data = $data->get_data(); } else { $data = '<no value>'; }
if (!$value_desc) { return sprintf("%-24s %s", $value.':', $data); }
return sprintf("%s %-24s %s", $value, '['.$value_desc.']:', $data);
}
1;