Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
perl5 /
Image /
ExifTool /
[ HOME SHELL ]
Name
Size
Permission
Action
Charset
[ DIR ]
drwxr-xr-x
Lang
[ DIR ]
drwxr-xr-x
AES.pm
18.66
KB
-rw-r--r--
AFCP.pm
10.38
KB
-rw-r--r--
AIFF.pm
9.59
KB
-rw-r--r--
APE.pm
9.06
KB
-rw-r--r--
APP12.pm
10.44
KB
-rw-r--r--
ASF.pm
30.21
KB
-rw-r--r--
Apple.pm
5.43
KB
-rw-r--r--
Audible.pm
11.52
KB
-rw-r--r--
BMP.pm
10.45
KB
-rw-r--r--
BPG.pm
7.53
KB
-rw-r--r--
BZZ.pm
17.46
KB
-rw-r--r--
BigTIFF.pm
11.27
KB
-rw-r--r--
BuildTagLookup.pm
121.94
KB
-rw-r--r--
CBOR.pm
11.51
KB
-rw-r--r--
Canon.pm
375.39
KB
-rw-r--r--
CanonCustom.pm
84.32
KB
-rw-r--r--
CanonRaw.pm
29.68
KB
-rw-r--r--
CanonVRD.pm
75.2
KB
-rw-r--r--
CaptureOne.pm
7.85
KB
-rw-r--r--
Casio.pm
62.21
KB
-rw-r--r--
Charset.pm
16.01
KB
-rw-r--r--
DICOM.pm
245.09
KB
-rw-r--r--
DJI.pm
6.31
KB
-rw-r--r--
DNG.pm
31.59
KB
-rw-r--r--
DPX.pm
9.51
KB
-rw-r--r--
DV.pm
9.75
KB
-rw-r--r--
DarwinCore.pm
15.43
KB
-rw-r--r--
DjVu.pm
12.46
KB
-rw-r--r--
EXE.pm
50.3
KB
-rw-r--r--
Exif.pm
246.64
KB
-rw-r--r--
FITS.pm
5.73
KB
-rw-r--r--
FLAC.pm
9.89
KB
-rw-r--r--
FLIF.pm
11.65
KB
-rw-r--r--
FLIR.pm
59.45
KB
-rw-r--r--
Fixup.pm
12.43
KB
-rw-r--r--
Flash.pm
27.5
KB
-rw-r--r--
FlashPix.pm
87.44
KB
-rw-r--r--
Font.pm
27.34
KB
-rw-r--r--
FotoStation.pm
7.97
KB
-rw-r--r--
FujiFilm.pm
54.47
KB
-rw-r--r--
GE.pm
2
KB
-rw-r--r--
GIF.pm
21.85
KB
-rw-r--r--
GIMP.pm
8.35
KB
-rw-r--r--
GPS.pm
19.53
KB
-rw-r--r--
GeoTiff.pm
87.51
KB
-rw-r--r--
Geotag.pm
62.87
KB
-rw-r--r--
GoPro.pm
28
KB
-rw-r--r--
H264.pm
39.29
KB
-rw-r--r--
HP.pm
8
KB
-rw-r--r--
HTML.pm
22.1
KB
-rw-r--r--
HtmlDump.pm
32.8
KB
-rw-r--r--
ICC_Profile.pm
45.63
KB
-rw-r--r--
ID3.pm
56.91
KB
-rw-r--r--
IPTC.pm
39.54
KB
-rw-r--r--
ISO.pm
6.81
KB
-rw-r--r--
ITC.pm
6.63
KB
-rw-r--r--
Import.pm
12.83
KB
-rw-r--r--
InDesign.pm
10.4
KB
-rw-r--r--
JPEG.pm
24.3
KB
-rw-r--r--
JPEGDigest.pm
212.38
KB
-rw-r--r--
JSON.pm
6.15
KB
-rw-r--r--
JVC.pm
3.57
KB
-rw-r--r--
Jpeg2000.pm
49.65
KB
-rw-r--r--
Kodak.pm
120.47
KB
-rw-r--r--
KyoceraRaw.pm
4.31
KB
-rw-r--r--
LIF.pm
4.66
KB
-rw-r--r--
LNK.pm
22.02
KB
-rw-r--r--
Leaf.pm
16.34
KB
-rw-r--r--
Lytro.pm
7.56
KB
-rw-r--r--
M2TS.pm
37.11
KB
-rw-r--r--
MIE.pm
102.09
KB
-rw-r--r--
MIEUnits.pod
13.68
KB
-rw-r--r--
MIFF.pm
9.05
KB
-rw-r--r--
MNG.pm
16.22
KB
-rw-r--r--
MOI.pm
4.14
KB
-rw-r--r--
MPC.pm
4.05
KB
-rw-r--r--
MPEG.pm
22.32
KB
-rw-r--r--
MPF.pm
8.94
KB
-rw-r--r--
MRC.pm
18.39
KB
-rw-r--r--
MWG.pm
30.64
KB
-rw-r--r--
MXF.pm
252.65
KB
-rw-r--r--
MacOS.pm
30.7
KB
-rw-r--r--
MakerNotes.pm
68.93
KB
-rw-r--r--
Matroska.pm
34.44
KB
-rw-r--r--
Microsoft.pm
52.13
KB
-rw-r--r--
Minolta.pm
99.93
KB
-rw-r--r--
MinoltaRaw.pm
16.49
KB
-rw-r--r--
Motorola.pm
5.31
KB
-rw-r--r--
Nikon.pm
431.96
KB
-rw-r--r--
NikonCapture.pm
28.13
KB
-rw-r--r--
NikonCustom.pm
290.78
KB
-rw-r--r--
NikonSettings.pm
71.88
KB
-rw-r--r--
Nintendo.pm
3.24
KB
-rw-r--r--
OOXML.pm
13.61
KB
-rw-r--r--
Ogg.pm
8.81
KB
-rw-r--r--
Olympus.pm
139.89
KB
-rw-r--r--
OpenEXR.pm
10.26
KB
-rw-r--r--
Opus.pm
2.22
KB
-rw-r--r--
Other.pm
2.63
KB
-rw-r--r--
PCX.pm
3.72
KB
-rw-r--r--
PDF.pm
90.77
KB
-rw-r--r--
PGF.pm
4.04
KB
-rw-r--r--
PICT.pm
33.2
KB
-rw-r--r--
PLIST.pm
17.07
KB
-rw-r--r--
PLUS.pm
147.71
KB
-rw-r--r--
PNG.pm
60.72
KB
-rw-r--r--
PPM.pm
4.97
KB
-rw-r--r--
PSP.pm
9.02
KB
-rw-r--r--
Palm.pm
11.9
KB
-rw-r--r--
Panasonic.pm
96.62
KB
-rw-r--r--
PanasonicRaw.pm
31.77
KB
-rw-r--r--
Parrot.pm
20.95
KB
-rw-r--r--
Pentax.pm
220.46
KB
-rw-r--r--
PhaseOne.pm
26.24
KB
-rw-r--r--
PhotoCD.pm
18.25
KB
-rw-r--r--
PhotoMechanic.pm
8.09
KB
-rw-r--r--
Photoshop.pm
43.36
KB
-rw-r--r--
PostScript.pm
29.11
KB
-rw-r--r--
PrintIM.pm
3.44
KB
-rw-r--r--
Qualcomm.pm
43.43
KB
-rw-r--r--
QuickTime.pm
409.72
KB
-rw-r--r--
QuickTimeStream.pl
126.03
KB
-rw-r--r--
RIFF.pm
70.97
KB
-rw-r--r--
RSRC.pm
9.58
KB
-rw-r--r--
RTF.pm
13.46
KB
-rw-r--r--
Radiance.pm
4.56
KB
-rw-r--r--
Rawzor.pm
6.17
KB
-rw-r--r--
Real.pm
26.89
KB
-rw-r--r--
Reconyx.pm
14.2
KB
-rw-r--r--
Red.pm
10.82
KB
-rw-r--r--
Ricoh.pm
37.18
KB
-rw-r--r--
Samsung.pm
54.64
KB
-rw-r--r--
Sanyo.pm
11.83
KB
-rw-r--r--
Scalado.pm
3.91
KB
-rw-r--r--
Shift.pl
23.28
KB
-rw-r--r--
Shortcuts.pm
9.81
KB
-rw-r--r--
Sigma.pm
33.16
KB
-rw-r--r--
SigmaRaw.pm
23.45
KB
-rw-r--r--
Sony.pm
439.69
KB
-rw-r--r--
SonyIDC.pm
11.95
KB
-rw-r--r--
Stim.pm
4.53
KB
-rw-r--r--
TagInfoXML.pm
33.14
KB
-rw-r--r--
TagLookup.pm
647.18
KB
-rw-r--r--
TagNames.pod
1.76
MB
-rw-r--r--
Text.pm
8.12
KB
-rw-r--r--
Theora.pm
3.41
KB
-rw-r--r--
Torrent.pm
11.58
KB
-rw-r--r--
Unknown.pm
1.69
KB
-rw-r--r--
VCard.pm
17.31
KB
-rw-r--r--
Validate.pm
29.75
KB
-rw-r--r--
Vorbis.pm
8.13
KB
-rw-r--r--
WTV.pm
12.97
KB
-rw-r--r--
WriteCanonRaw.pl
24.29
KB
-rw-r--r--
WriteExif.pl
130.6
KB
-rw-r--r--
WriteIPTC.pl
29.6
KB
-rw-r--r--
WritePDF.pl
29.02
KB
-rw-r--r--
WritePNG.pl
16.07
KB
-rw-r--r--
WritePhotoshop.pl
10.85
KB
-rw-r--r--
WritePostScript.pl
26.71
KB
-rw-r--r--
WriteQuickTime.pl
89.63
KB
-rw-r--r--
WriteXMP.pl
70.49
KB
-rw-r--r--
Writer.pl
301.76
KB
-rw-r--r--
XMP.pm
176.89
KB
-rw-r--r--
XMP2.pl
81.66
KB
-rw-r--r--
XMPStruct.pl
36.66
KB
-rw-r--r--
ZIP.pm
27.61
KB
-rw-r--r--
ZISRAW.pm
7.85
KB
-rw-r--r--
iWork.pm
7.79
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : LNK.pm
#------------------------------------------------------------------------------ # File: LNK.pm # # Description: Read meta information from MS Shell Link files # # Revisions: 2009/09/19 - P. Harvey Created # # References: 1) http://msdn.microsoft.com/en-us/library/dd871305(PROT.10).aspx # 2) http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf #------------------------------------------------------------------------------ package Image::ExifTool::LNK; use strict; use vars qw($VERSION); use Image::ExifTool qw(:DataAccess :Utils); $VERSION = '1.07'; sub ProcessItemID($$$); sub ProcessLinkInfo($$$); # Information extracted from LNK (Windows Shortcut) files %Image::ExifTool::LNK::Main = ( PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, GROUPS => { 2 => 'Other' }, VARS => { HEX_ID => 1 }, # print hex ID's in documentation NOTES => 'Information extracted from MS Shell Link (Windows shortcut) files.', # maybe the Flags aren't very useful to the user (since they are # mainly structural), but extract them anyway for completeness 0x14 => { Name => 'Flags', Format => 'int32u', PrintConv => { BITMASK => { 0 => 'IDList', 1 => 'LinkInfo', 2 => 'Description', 3 => 'RelativePath', 4 => 'WorkingDir', 5 => 'CommandArgs', 6 => 'IconFile', 7 => 'Unicode', 8 => 'NoLinkInfo', 9 => 'ExpString', 10 => 'SeparateProc', 12 => 'DarwinID', 13 => 'RunAsUser', 14 => 'ExpIcon', 15 => 'NoPidAlias', 17 => 'RunWithShim', 18 => 'NoLinkTrack', 19 => 'TargetMetadata', 20 => 'NoLinkPathTracking', 21 => 'NoKnownFolderTracking', 22 => 'NoKnownFolderAlias', 23 => 'LinkToLink', 24 => 'UnaliasOnSave', 25 => 'PreferEnvPath', 26 => 'KeepLocalIDList', }}, }, 0x18 => { Name => 'FileAttributes', Format => 'int32u', PrintConv => { BITMASK => { 0 => 'Read-only', 1 => 'Hidden', 2 => 'System', 3 => 'Volume', #(not used) 4 => 'Directory', 5 => 'Archive', 6 => 'Encrypted?', #(ref 2, not used in XP) 7 => 'Normal', 8 => 'Temporary', 9 => 'Sparse', 10 => 'Reparse point', 11 => 'Compressed', 12 => 'Offline', 13 => 'Not indexed', 14 => 'Encrypted', }}, }, 0x1c => { Name => 'CreateDate', Format => 'int64u', Groups => { 2 => 'Time' }, # convert time from 100-ns intervals since Jan 1, 1601 RawConv => '$val ? $val : undef', ValueConv => '$val=$val/1e7-11644473600; ConvertUnixTime($val,1)', PrintConv => '$self->ConvertDateTime($val)', }, 0x24 => { Name => 'AccessDate', Format => 'int64u', Groups => { 2 => 'Time' }, RawConv => '$val ? $val : undef', ValueConv => '$val=$val/1e7-11644473600; ConvertUnixTime($val,1)', PrintConv => '$self->ConvertDateTime($val)', }, 0x2c => { Name => 'ModifyDate', Format => 'int64u', Groups => { 2 => 'Time' }, RawConv => '$val ? $val : undef', ValueConv => '$val=$val/1e7-11644473600; ConvertUnixTime($val,1)', PrintConv => '$self->ConvertDateTime($val)', }, 0x34 => { Name => 'TargetFileSize', Format => 'int32u', }, 0x38 => { Name => 'IconIndex', Format => 'int32u', PrintConv => '$val ? $val : "(none)"', }, 0x3c => { Name => 'RunWindow', Format => 'int32u', PrintConv => { 0 => 'Hide', 1 => 'Normal', 2 => 'Show Minimized', 3 => 'Show Maximized', 4 => 'Show No Activate', 5 => 'Show', 6 => 'Minimized', 7 => 'Show Minimized No Activate', 8 => 'Show NA', 9 => 'Restore', 10 => 'Show Default', }, }, 0x40 => { Name => 'HotKey', Format => 'int32u', PrintHex => 1, PrintConv => { OTHER => sub { my $val = shift; my $ch = $val & 0xff; if (chr $ch =~ /^[A-Z0-9]$/) { $ch = chr $ch; } elsif ($ch >= 0x70 and $ch <= 0x87) { $ch = 'F' . ($ch - 0x6f); } elsif ($ch == 0x90) { $ch = 'Num Lock'; } elsif ($ch == 0x91) { $ch = 'Scroll Lock'; } else { $ch = sprintf('Unknown (0x%x)', $ch); } $ch = "Alt-$ch" if $val & 0x400; $ch = "Control-$ch" if $val & 0x200; $ch = "Shift-$ch" if $val & 0x100; return $ch; }, 0x00 => '(none)', # these entries really only for documentation 0x90 => 'Num Lock', 0x91 => 'Scroll Lock', "0x30'-'0x39" => "0-9", "0x41'-'0x5a" => "A-Z", "0x70'-'0x87" => "F1-F24", 0x100 => 'Shift', 0x200 => 'Control', 0x400 => 'Alt', }, }, # note: tags 0x10xx are synthesized tag ID's 0x10000 => { Name => 'ItemID', SubDirectory => { TagTable => 'Image::ExifTool::LNK::ItemID' }, }, 0x20000 => { Name => 'LinkInfo', SubDirectory => { TagTable => 'Image::ExifTool::LNK::LinkInfo' }, }, 0x30004 => 'Description', 0x30008 => 'RelativePath', 0x30010 => 'WorkingDirectory', 0x30020 => 'CommandLineArguments', 0x30040 => 'IconFileName', # note: tags 0xa000000x are actually ID's (not indices) 0xa0000000 => { Name => 'UnknownData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000001 => { Name => 'EnvVarData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000002 => { Name => 'ConsoleData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::ConsoleData' }, }, 0xa0000003 => { Name => 'TrackerData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::TrackerData' }, }, 0xa0000004 => { Name => 'ConsoleFEData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::ConsoleFEData' }, }, 0xa0000005 => { Name => 'SpecialFolderData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000006 => { Name => 'DarwinData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000007 => { Name => 'IconEnvData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000008 => { Name => 'ShimData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa0000009 => { Name => 'PropertyStoreData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa000000b => { Name => 'KnownFolderData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, 0xa000000c => { Name => 'VistaIDListData', SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }, ); %Image::ExifTool::LNK::ItemID = ( GROUPS => { 2 => 'Other' }, PROCESS_PROC => \&ProcessItemID, # (can't find any documentation on these items) 0x0032 => { Name => 'Item0032', SubDirectory => { TagTable => 'Image::ExifTool::LNK::Item0032' }, }, ); %Image::ExifTool::LNK::Item0032 = ( GROUPS => { 2 => 'Other' }, PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, 0x0e => { Name => 'TargetFileDOSName', Format => 'var_string', }, #not at a fixed offset -- offset is given by last 2 bytes of the item + 0x14 #0x22 => { # Name => 'TargetFileName', # Format => 'var_ustring', #}, ); %Image::ExifTool::LNK::LinkInfo = ( GROUPS => { 2 => 'Other' }, PROCESS_PROC => \&ProcessLinkInfo, FORMAT => 'int32u', VARS => { NO_ID => 1 }, VolumeID => { }, DriveType => { PrintConv => { 0 => 'Unknown', 1 => 'Invalid Root Path', 2 => 'Removable Media', 3 => 'Fixed Disk', 4 => 'Remote Drive', 5 => 'CD-ROM', 6 => 'Ram Disk', }, }, DriveSerialNumber => { }, VolumeLabel => { }, LocalBasePath => { }, CommonNetworkRelLink => { }, CommonPathSuffix => { }, NetName => { }, DeviceName => { }, NetProviderType => { PrintHex => 1, PrintConv => { 0x1a0000 => 'AVID', 0x1b0000 => 'DOCUSPACE', 0x1c0000 => 'MANGOSOFT', 0x1d0000 => 'SERNET', 0x1e0000 => 'RIVERFRONT1', 0x1f0000 => 'RIVERFRONT2', 0x200000 => 'DECORB', 0x210000 => 'PROTSTOR', 0x220000 => 'FJ_REDIR', 0x230000 => 'DISTINCT', 0x240000 => 'TWINS', 0x250000 => 'RDR2SAMPLE', 0x260000 => 'CSC', 0x270000 => '3IN1', 0x290000 => 'EXTENDNET', 0x2a0000 => 'STAC', 0x2b0000 => 'FOXBAT', 0x2c0000 => 'YAHOO', 0x2d0000 => 'EXIFS', 0x2e0000 => 'DAV', 0x2f0000 => 'KNOWARE', 0x300000 => 'OBJECT_DIRE', 0x310000 => 'MASFAX', 0x320000 => 'HOB_NFS', 0x330000 => 'SHIVA', 0x340000 => 'IBMAL', 0x350000 => 'LOCK', 0x360000 => 'TERMSRV', 0x370000 => 'SRT', 0x380000 => 'QUINCY', 0x390000 => 'OPENAFS', 0x3a0000 => 'AVID1', 0x3b0000 => 'DFS', }, }, ); %Image::ExifTool::LNK::UnknownData = ( PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, GROUPS => { 2 => 'Other' }, ); %Image::ExifTool::LNK::ConsoleData = ( PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, GROUPS => { 2 => 'Other' }, 0x08 => { Name => 'FillAttributes', Format => 'int16u', PrintConv => 'sprintf("0x%.2x", $val)', }, 0x0a => { Name => 'PopupFillAttributes', Format => 'int16u', PrintConv => 'sprintf("0x%.2x", $val)', }, 0x0c => { Name => 'ScreenBufferSize', Format => 'int16u[2]', PrintConv => '$val=~s/ / x /; $val', }, 0x10 => { Name => 'WindowSize', Format => 'int16u[2]', PrintConv => '$val=~s/ / x /; $val', }, 0x14 => { Name => 'WindowOrigin', Format => 'int16u[2]', PrintConv => '$val=~s/ / x /; $val', }, 0x20 => { Name => 'FontSize', Format => 'int16u[2]', PrintConv => '$val=~s/ / x /; $val', }, 0x24 => { Name => 'FontFamily', Format => 'int32u', PrintHex => 1, PrintConv => { 0 => "Don't Care", 0x10 => 'Roman', 0x20 => 'Swiss', 0x30 => 'Modern', 0x40 => 'Script', 0x50 => 'Decorative', }, }, 0x28 => { Name => 'FontWeight', Format => 'int32u', }, 0x2c => { Name => 'FontName', Format => 'undef[64]', RawConv => q{ $val = $self->Decode($val, 'UCS2'); $val =~ s/\0.*//s; return length($val) ? $val : undef; }, }, 0x6c => { Name => 'CursorSize', Format => 'int32u', }, 0x70 => { Name => 'FullScreen', Format => 'int32u', PrintConv => '$val ? "Yes" : "No"', }, 0x74 => { #PH (MISSING FROM MS DOCUMENTATION! -- screws up subsequent offsets) Name => 'QuickEdit', Format => 'int32u', PrintConv => '$val ? "Yes" : "No"', }, 0x78 => { Name => 'InsertMode', Format => 'int32u', PrintConv => '$val ? "Yes" : "No"', }, 0x7c => { Name => 'WindowOriginAuto', Format => 'int32u', PrintConv => '$val ? "Yes" : "No"', }, 0x80 => { Name => 'HistoryBufferSize', Format => 'int32u', }, 0x84 => { Name => 'NumHistoryBuffers', Format => 'int32u', }, 0x88 => { Name => 'RemoveHistoryDuplicates', Format => 'int32u', PrintConv => '$val ? "Yes" : "No"', }, ); %Image::ExifTool::LNK::TrackerData = ( PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, GROUPS => { 2 => 'Other' }, 0x10 => { Name => 'MachineID', Format => 'var_string', }, ); %Image::ExifTool::LNK::ConsoleFEData = ( PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData, GROUPS => { 2 => 'Other' }, 0x08 => { Name => 'CodePage', Format => 'int32u', }, ); #------------------------------------------------------------------------------ # Extract null-terminated ASCII or Unicode string from buffer # Inputs: 0) buffer ref, 1) start position, 2) flag for unicode string # Return: string or undef if start position is outside bounds sub GetString($$;$) { my ($dataPt, $pos, $unicode) = @_; return undef if $pos >= length($$dataPt); pos($$dataPt) = $pos; return $1 if ($unicode ? $$dataPt=~/\G((?:..)*?)\0\0/sg : $$dataPt=~/\G(.*?)\0/sg); return substr($$dataPt, $pos); } #------------------------------------------------------------------------------ # Process item ID data # Inputs: 0) ExifTool object reference, 1) dirInfo reference, 2) tag table ref # Returns: 1 on success sub ProcessItemID($$$) { my ($et, $dirInfo, $tagTablePtr) = @_; my $dataPt = $$dirInfo{DataPt}; my $dataLen = length $$dataPt; my $pos = 0; my %opts = ( DataPt => $dataPt, DataPos => $$dirInfo{DataPos}, ); $et->VerboseDir('ItemID', undef, $dataLen); for (;;) { last if $pos + 4 >= $dataLen; my $size = Get16u($dataPt, $pos); last if $size < 2 or $pos + $size > $dataLen; my $tag = Get16u($dataPt, $pos+2); # (just a guess -- may not be a tag at all) AddTagToTable($tagTablePtr, $tag, { Name => sprintf('Item%.4x', $tag), SubDirectory => { TagTable => 'Image::ExifTool::LNK::UnknownData' }, }) unless $$tagTablePtr{$tag}; $et->HandleTag($tagTablePtr, $tag, undef, %opts, Start => $pos, Size => $size); $pos += $size; } } #------------------------------------------------------------------------------ # Process link information data # Inputs: 0) ExifTool object reference, 1) dirInfo reference, 2) tag table ref # Returns: 1 on success sub ProcessLinkInfo($$$) { my ($et, $dirInfo, $tagTablePtr) = @_; my $dataPt = $$dirInfo{DataPt}; my $dataLen = length $$dataPt; return 0 if $dataLen < 0x20; my $hdrLen = Get32u($dataPt, 4); my $lif = Get32u($dataPt, 8); # link info flags my %opts = ( DataPt => $dataPt, DataPos => $$dirInfo{DataPos}, Size => 4, # (typical value size) ); my ($off, $unicode, $pos, $val, $size); $et->VerboseDir('LinkInfo', undef, $dataLen); if ($lif & 0x01) { # read Volume ID $off = Get32u($dataPt, 0x0c); if ($off + 0x20 <= $dataLen) { # my $len = Get32u($dataPt, $off); $et->HandleTag($tagTablePtr, 'DriveType', undef, %opts, Start=>$off+4); $pos = Get32u($dataPt, $off + 0x0c); if ($pos == 0x14) { # use VolumeLabelOffsetUnicode instead $pos = Get32u($dataPt, $off + 0x10); $unicode = 1; } $pos += $off; $val = GetString($dataPt, $pos, $unicode); if (defined $val) { $size = length $val; $val = $et->Decode($val, 'UCS2') if $unicode; $et->HandleTag($tagTablePtr, 'VolumeLabel', $val, %opts, Start=>$pos, Size=>$size); } } # read local base path if ($hdrLen >= 0x24) { $pos = Get32u($dataPt, 0x1c); $unicode = 1; } else { $pos = Get32u($dataPt, 0x10); undef $unicode; } $val = GetString($dataPt, $pos, $unicode); if (defined $val) { $size = length $val; $val = $et->Decode($val, 'UCS2') if $unicode; $et->HandleTag($tagTablePtr, 'LocalBasePath', $val, %opts, Start=>$pos, Size=>$size); } } if ($lif & 0x02) { # read common network relative link $off = Get32u($dataPt, 0x14); if ($off and $off + 0x14 <= $dataLen) { my $siz = Get32u($dataPt, $off); $pos = Get32u($dataPt, $off + 0x08); if ($pos > 0x14 and $siz >= 0x18) { $pos = Get32u($dataPt, $off + 0x14); $unicode = 1; } else { undef $unicode; } $val = GetString($dataPt, $pos, $unicode); if (defined $val) { $size = length $val; $val = $et->Decode($val, 'UCS2') if $unicode; $et->HandleTag($tagTablePtr, 'NetName', $val, %opts, Start=>$pos, Size=>$size); } my $flg = Get32u($dataPt, $off + 0x04); if ($flg & 0x01) { $pos = Get32u($dataPt, $off + 0x0c); if ($pos > 0x14 and $siz >= 0x1c) { $pos = Get32u($dataPt, $off + 0x18); $unicode = 1; } else { undef $unicode; } $val = GetString($dataPt, $pos, $unicode); if (defined $val) { $size = length $val; $val = $et->Decode($val, 'UCS2') if $unicode; $et->HandleTag($tagTablePtr, 'DeviceName', $val, %opts, Start=>$pos, Size=>$size); } } if ($flg & 0x02) { $val = Get32u($dataPt, $off + 0x10); $et->HandleTag($tagTablePtr, 'NetProviderType', $val, %opts, Start=>$off + 0x10); } } } return 1; } #------------------------------------------------------------------------------ # Extract information from a MS Shell Link (Windows shortcut) file # Inputs: 0) ExifTool object reference, 1) dirInfo reference # Returns: 1 on success, 0 if this wasn't a valid LNK file sub ProcessLNK($$) { my ($et, $dirInfo) = @_; my $raf = $$dirInfo{RAF}; my ($buff, $buf2, $len, $i); # read LNK file header $raf->Read($buff, 0x4c) == 0x4c or return 0; $buff =~ /^.{4}\x01\x14\x02\0{5}\xc0\0{6}\x46/s or return 0; $len = unpack('V', $buff); $len >= 0x4c or return 0; if ($len > 0x4c) { $raf->Read($buf2, $len - 0x4c) == $len - 0x4c or return 0; $buff .= $buf2; } $et->SetFileType(); SetByteOrder('II'); my $tagTablePtr = GetTagTable('Image::ExifTool::LNK::Main'); my %dirInfo = ( DataPt => \$buff, DataPos => 0, DataLen => length $buff, DirLen => length $buff, ); $et->ProcessDirectory(\%dirInfo, $tagTablePtr); my $flags = Get32u(\$buff, 0x14); # read link target ID list if ($flags & 0x01) { $raf->Read($buff, 2) or return 1; $len = unpack('v', $buff); $raf->Read($buff, $len) == $len or return 1; $et->HandleTag($tagTablePtr, 0x10000, undef, DataPt => \$buff, DataPos => $raf->Tell() - $len, Size => $len, ); } # read link information if ($flags & 0x02) { $raf->Read($buff, 4) or return 1; $len = unpack('V', $buff); return 1 if $len < 4; $raf->Read($buf2, $len - 4) == $len - 4 or return 1; $buff .= $buf2; $et->HandleTag($tagTablePtr, 0x20000, undef, DataPt => \$buff, DataPos => $raf->Tell() - $len, Size => $len, ); } # read string data my @strings = qw(Description RelativePath WorkingDirectory CommandLineArguments IconFileName); for ($i=0; $i<@strings; ++$i) { my $mask = 0x04 << $i; next unless $flags & $mask; $raf->Read($buff, 2) or return 1; $len = unpack('v', $buff); $len *= 2 if $flags & 0x80; # characters are 2 bytes if Unicode flag is set $raf->Read($buff, $len) or return 1; my $val; $val = $et->Decode($buff, 'UCS2') if $flags & 0x80; $et->HandleTag($tagTablePtr, 0x30000 | $mask, $val, DataPt => \$buff, DataPos => $raf->Tell() - $len, Size => $len, ); } # read extra data while ($raf->Read($buff, 4) == 4) { $len = unpack('V', $buff); last if $len < 4; $len -= 4; $raf->Read($buf2, $len) == $len or last; next unless $len > 4; $buff .= $buf2; my $tag = Get32u(\$buff, 4); my $tagInfo = $$tagTablePtr{$tag}; unless (ref $tagInfo eq 'HASH' and $$tagInfo{SubDirectory}) { $tagInfo = $$tagTablePtr{0xa0000000}; } $et->HandleTag($tagTablePtr, $tag, undef, DataPt => \$buff, DataPos => $raf->Tell() - $len - 4, TagInfo => $tagInfo, ); } return 1; } 1; # end __END__ =head1 NAME Image::ExifTool::LNK - Read MS Shell Link (.LNK) meta information =head1 SYNOPSIS This module is used by Image::ExifTool =head1 DESCRIPTION This module contains definitions required by Image::ExifTool to extract meta information MS Shell Link (Windows shortcut) files. =head1 AUTHOR Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 REFERENCES =over 4 =item L<http://msdn.microsoft.com/en-us/library/dd871305(PROT.10).aspx> =item L<http://www.i2s-lab.com/Papers/The_Windows_Shortcut_File_Format.pdf> =back =head1 SEE ALSO L<Image::ExifTool::TagNames/LNK Tags>, L<Image::ExifTool(3pm)|Image::ExifTool> =cut
Close