-
Notifications
You must be signed in to change notification settings - Fork 1
/
foxitrdr.pl
287 lines (275 loc) · 8.4 KB
/
foxitrdr.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
#-----------------------------------------------------------
# foxitrdr.pl
# Plugin for Registry Ripper
#
# Parse Foxit Reader MRU keys:
# - HKCU\SOFTWARE\Foxit Software\Foxit Reader X.0\CommentPanel\Filter
# - HKCU\SOFTWARE\Foxit Software\Foxit Reader X.0\MRU\File MRU
# - HKCU\SOFTWARE\Foxit Software\Foxit Reader X.0\MRU\Place MRU
# - HKCU\SOFTWARE\Foxit Software\Foxit Reader X.0\Preferences\History\LastOpen
#
# The script is based on:
# - adoberdr.pl by H. Carvey
# - iexplore.pl by E. Rye esten@ryezone.net
# http://www.ryezone.net/regripper-and-internet-explorer-1
#
# Change history
# 20201231 - Added extraction from key path "CommentPanel\Filter". Thanks to Hyun Yi (hyuunnn)
# 20170326 - First release
#
# References
# https://forensenellanebbia.blogspot.it/2017/04/regripper-plugin-to-parse-foxit-reader.html
#
# copyright 2017 Gabriele Zambelli @gazambelli
#-----------------------------------------------------------
package foxitrdr;
use strict;
my %config = (hive => "NTUSER\.DAT",
osmask => 22,
hasShortDescr => 1,
hasDescr => 0,
hasRefs => 0,
version => 20201231);
sub getShortDescr { return "Get values from the user's Foxit Reader key"; }
sub getDescr {}
sub getRefs {}
sub getHive {return $config{hive};}
sub getVersion {return $config{version};}
my $VERSION = getVersion();
sub pluginmain {
my $class = shift;
my $hive = shift;
::rptMsg("foxitrdr v.".$VERSION);
::rptMsg("(".getHive().") ".getShortDescr()."\n");
my $reg = Parse::Win32Registry->new($hive);
my $root_key = $reg->get_root_key;
# First, let's find out which version of Foxit Reader is installed
my $version;
my $tag = 0;
my @globalitems = ();
my @versions = (1..100);
foreach my $ver (@versions) {
my $key_path = "Software\\Foxit Software\\Foxit Reader ".$ver.".0";
if (defined($root_key->get_subkey($key_path))) {
$version = $ver.".0";
$tag = 1;
}
}
#\\MRU
if ($tag) {
::rptMsg("Foxit Reader version ".$version." located.");
my $key_path = "Software\\Foxit Software\\Foxit Reader ".$version;
my $key;
if ($key = $root_key->get_subkey($key_path."\\MRU")) {
::rptMsg($key_path);
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
my %vals = getKeyValues($key);
if (scalar(keys %vals) > 0) {
foreach my $v (keys %vals) {
::rptMsg("\t".$v." -> ".$vals{$v});
}
}
else {
}
my @sk = $key->get_list_of_subkeys();
if (scalar(@sk) > 0) {
foreach my $s (@sk) {
::rptMsg("");
::rptMsg($key_path."\\".$s->get_name());
::rptMsg("LastWrite Time ".gmtime($s->get_timestamp())." (UTC)");
my %vals = getKeyValues($s);
::rptMsg("Note: All value names are listed in MRUList order.\n");
foreach my $v (sort { substr($a, 4) <=> substr($b, 4) } keys %vals) {
$vals{$v} =~ s/\[F000000000\]\*//g;
::rptMsg("\t".$v." -> ".$vals{$v});
my $temp = ($v." -> ".$vals{$v});
if (substr($temp, -4) =~ /\.pdf/i) {
push (@globalitems, $temp);
}
}
}
}
else {
::rptMsg("");
::rptMsg($key_path." has no subkeys.");
}
}
else {
::rptMsg($key_path." not found.");
::logMsg($key_path." not found.");
}
}
else {
::rptMsg("Foxit Reader version not found.");
}
#\\CommentPanel\\Filter
if ($tag) {
my $key_path = "Software\\Foxit Software\\Foxit Reader ".$version;
my $key;
if ($key = $root_key->get_subkey($key_path."\\CommentPanel\\Filter")) {
::rptMsg("\n\n".$key_path."\\CommentPanel\\Filter");
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
my %vals = getKeyValues($key);
if (scalar(keys %vals) > 0) {
foreach my $v (keys %vals) {
::rptMsg("\t".$v." -> ".$vals{$v});
}
}
else {
}
my @sk = $key->get_list_of_subkeys();
my @arr;
if (scalar(@sk) > 0) {
foreach my $s (@sk) {
#::rptMsg($key_path."\\CommentPanel\\Filter\\".$s->get_name());
my %vals = getKeyValues($s);
my $record_file;
my $record_order;
foreach my $v (keys %vals) {
if ($v =~ m/^File/) {
$record_file = $vals{$v};
}
if ($v =~ m/^Order/) {
$record_order = $vals{$v};
}
}
push (@arr, $record_order."\t".$record_file);
}
if (scalar(@arr) > 0) {
::rptMsg("Note: All value names are listed in MRU order (0 = oldest)");
::rptMsg("\tOrder\tFile");
#sort items in the array
foreach my $i (sort {$b <=> $a} @arr){
::rptMsg("\t".$i);
}
}
}
else {
::rptMsg("");
::rptMsg($key_path." has no subkeys.");
}
}
else {
::rptMsg($key_path." not found.");
::logMsg($key_path." not found.");
}
}
else {
}
#\\Preferences\\History\\LastOpen
if ($tag) {
my $key_path = "Software\\Foxit Software\\Foxit Reader ".$version;
my $key;
if ($key = $root_key->get_subkey($key_path."\\Preferences\\History\\LastOpen")) {
::rptMsg("\n\n".$key_path."\\Preferences\\History\\LastOpen");
::rptMsg("LastWrite Time ".gmtime($key->get_timestamp())." (UTC)");
my %vals = getKeyValues($key);
if (scalar(keys %vals) > 0) {
foreach my $v (keys %vals) {
::rptMsg("\t".$v." -> ".$vals{$v});
}
}
else {
}
my @sk = $key->get_list_of_subkeys();
if (scalar(@sk) > 0) {
foreach my $s (@sk) {
::rptMsg("");
::rptMsg($key_path."\\Preferences\\History\\LastOpen\\".$s->get_name());
::rptMsg("LastWrite Time ".gmtime($s->get_timestamp())." (UTC)");
my %vals = getKeyValues($s);
foreach my $v (keys %vals) {
if ($v =~ m/^Scale/) {
::rptMsg("\t".$v." -> ".sprintf("%.2f",($vals{$v}*100))."%");
}
if ($v =~ m/^Page/) {
#Page: counter starts at 0 (page 0 is the first page of the PDF)
::rptMsg("\tLast Page Read -> ".($vals{$v}+1));
}
if ($v =~ m/^zoomToMode/) {
# zoomToMode 1 = Zoom
# zoomToMode 2 = Actual Page
# zoomToMode 3 = Fit Page
# zoomToMode 4 = Fit Width
# zoomToMode 7 = Fit Visible
if ($vals{$v} == 1) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Zoom]");
}
elsif ($vals{$v} == 2) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Actual Page]");
}
elsif ($vals{$v} == 3) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Fit Page]");
}
elsif ($vals{$v} == 4) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Fit Width]");
}
elsif ($vals{$v} == 7) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Fit Visible]");
}
else {
::rptMsg("\t".$v." -> ".$vals{$v});
}
}
if ($v =~ m/^FileName/) {
::rptMsg("\tFileName (Short) -> ".$vals{$v});
my $number = $s->get_name();
foreach my $gi (@globalitems) {
if ($gi =~ /Item $number /) {
$gi =~ s/\Item $number ->//g;
::rptMsg("\tFileName (Long ) ->".$gi);
}
}
}
if ($v =~ m/^Mode/) {
#Mode 0 = Single Page (View one page at a time)
#Mode 1 = Continuous (view pages continuously with scrolling enabled)
#Mode 2 = Facing (View two pages side by side)
#Mode 3 = Continuous facing (View pages side-by-side with continuous scrolling enabled)
if ($vals{$v} == 0) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Single Page = View one page at a time]");
}
elsif ($vals{$v} == 1) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Continuous = View pages continuously with scrolling enabled]");
}
elsif ($vals{$v} == 2) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Facing = View two pages side by side]");
}
elsif ($vals{$v} == 3) {
::rptMsg("\t".$v." -> ".$vals{$v}." [Continuous facing = View pages side-by-side with continuous scrolling enabled]");
}
else {
::rptMsg("\t".$v." -> ".$vals{$v});
}
}
}
}
}
else {
::rptMsg("");
::rptMsg($key_path." has no subkeys.");
}
}
else {
::rptMsg($key_path." not found.");
::logMsg($key_path." not found.");
}
}
else {
}
}
sub getKeyValues {
my $key = shift;
my %vals;
my @vk = $key->get_list_of_values();
if (scalar(@vk) > 0) {
foreach my $v (@vk) {
next if ($v->get_name() eq "" && $v->get_data() eq "");
$vals{$v->get_name()} = $v->get_data();
}
}
else {
}
return %vals;
}
1;