public void Win81Lnk() { var winP = Path.Combine(Win81Path, "PhotosApp.lnk"); var lnk = Lnk.LoadFile(winP); lnk.RelativePath.Should().BeNull(); lnk.VolumeInfo.Should().BeNull(); lnk.IconLocation.Should().Be(@"%windir%\FileManager\PhotosApp.exe"); var evb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "EnvironmentVariableDataBlock") as EnvironmentVariableDataBlock; evb?.EnvironmentVariablesUnicode.Should().Be(@"%windir%\FileManager\PhotosApp.exe"); var psdb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "PropertyStoreDataBlock") as PropertyStoreDataBlock; psdb?.PropertyStore.Sheets.Count.Should().Be(6); var foo = psdb.PropertyStore.Sheets.Single(t => t.GUID == "86d40b4d-9069-443c-819a-2a54090dccec"); foo.PropertyNames.Count.Should().Be(9); foo.PropertyNames.First().Key.Should().Be("2"); foo.PropertyNames.First().Value.Should().Be("Assets\\PhotosSmallLogo.png"); var desc = Utils.GetDescriptionFromGuidAndKey("86d40b4d-9069-443c-819a-2a54090dccec", 2); desc.Should().Be("Tile Small Image Location"); lnk.ExtraBlocks.Count.Should().Be(2); }
public void Win7DirectoryLnk() { var win7LocalDir = Path.Combine(MiscPath, "local.directory.seven.test"); var lnk = Lnk.LoadFile(win7LocalDir); lnk.RelativePath.Should().Be(@"..\..\Administrator"); lnk.VolumeInfo.Should().NotBeNull(); lnk.VolumeInfo.DriveType.Should().Be(VolumeInfo.DriveTypes.DriveFixed); lnk.VolumeInfo.VolumeSerialNumber.Should().Be("502E1A8A"); lnk.VolumeInfo.VolumeLabel.Should().Be("SSD-WIN7"); lnk.LocalPath.Should().Be(@"C:\Users\"); var tdb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "TrackerDataBaseBlock") as TrackerDataBaseBlock; tdb?.VolumeDroid.Should().Be("4f7c66da-d320-4cc4-8d50-165dd98ebc01"); tdb?.FileDroid.Should().Be("136502ff-8c66-11df-b6eb-001377d34a59"); tdb?.MacAddress.Should().Be("00:13:77:d3:4a:59"); tdb?.MachineId.Should().Be("netbook"); tdb?.CreationTime.Year.Should().Be(2010); tdb?.CreationTime.Month.Should().Be(7); tdb?.CreationTime.Day.Should().Be(10); tdb?.CreationTime.Hour.Should().Be(20); tdb?.CreationTime.Minute.Should().Be(59); tdb?.CreationTime.Second.Should().Be(48); }
public void InvalidFileShouldThrowException() { var badFile = Path.Combine(BadPath, "$I2GXWHL.lnk"); Action action = () => Lnk.LoadFile(badFile); action.ShouldThrow <Exception>().WithMessage("Invalid signature!"); }
public void UnicodeNetworkPath() { var winP = Path.Combine(MiscPath, "unicodeNetworkPath.lnk.test"); var lnk = Lnk.LoadFile(winP); Debug.WriteLine(lnk); }
public void DarwinBlockLnk() { var darwin = Path.Combine(MiscPath, "local.file.darwin.test"); var lnk = Lnk.LoadFile(darwin); var d = lnk.ExtraBlocks.Single(t => t is DarwinDataBlock) as DarwinDataBlock; d?.ProductCode.Should().Be("{AC76BA86-7AD7-1036-7B44-A93000000001}"); d?.ComponentId.Should().Be("{F95C9759-13AF-4E41-A46B-DBD281608D53}"); d?.FeatureName.Should().Be("ReaderProgramFiles"); }
public void foobar() { var foo = Lnk.LoadFile(@"C:\Temp\47E99F32FDDD19BD94A36BD52E4964FC"); var d = foo.ExtraBlocks.Single(t => t is DarwinDataBlock) as DarwinDataBlock; d?.ProductCode.Should().Be("{7F8559D1-2FF8-4E22-8885-E74D39A1A80E}"); d?.ComponentId.Should().Be("{BDDFA5DC-BD69-4232-998E-5167814C21B9}"); d?.FeatureName.Should().Be("Main"); Debug.WriteLine(foo); }
public void BaseTests() { foreach (var allPath in _allPaths) { foreach (var file in Directory.GetFiles(allPath, "*.test")) { var lk = Lnk.LoadFile(file); lk.Should().NotBe(null); lk.Header.Should().NotBeNull(); } } }
public void RemoteFileLnk() { var winP = Path.Combine(MiscPath, "remote.file.xp.test"); var lnk = Lnk.LoadFile(winP); lnk.RelativePath.Should().BeNull(); lnk.VolumeInfo.Should().BeNull(); lnk.NetworkShareInfo.NetworkShareName.Should().Be("\\\\ALS-FICHIERS3\\QUALITÉ"); lnk.NetworkShareInfo.NetworkProviderType.Should().Be(NetworkShareInfo.ProviderType.WnncNetLanman); var dom = lnk.TargetIDs.Single(t => t.FriendlyName == "Domain/Workgroup name"); dom.Value.Should().Be("Aldec_lyon"); lnk.CommonPath.Should().Be(@"Archives\Méthodologie WAS\Norme de développement JAVA.doc"); var tdb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "TrackerDataBaseBlock") as TrackerDataBaseBlock; tdb?.VolumeDroid.Should().Be("00000000-0000-0000-0000-000000000000"); tdb?.FileDroid.Should().Be("ea461b34-9877-11da-80bd-000f1ff7c0dc"); tdb?.MacAddress.Should().Be("00:0f:1f:f7:c0:dc"); tdb?.MachineId.Should().Be("als-fichiers3"); tdb?.CreationTime.Year.Should().Be(2006); tdb?.CreationTime.Month.Should().Be(2); tdb?.CreationTime.Day.Should().Be(8); tdb?.CreationTime.Hour.Should().Be(7); tdb?.CreationTime.Minute.Should().Be(52); tdb?.CreationTime.Second.Should().Be(55); lnk.ExtraBlocks.Count.Should().Be(1); var tID = lnk.TargetIDs.Last(); tID.ExtensionBlocks.Count.Should().Be(1); tID.Value.Should().Be("Norme de développement JAVA.doc"); var b4 = tID.ExtensionBlocks.Last() as Beef0004; b4?.MFTInformation.MFTEntryNumber.Should().Be(null); b4?.MFTInformation.MFTSequenceNumber.Should().Be(null); var tsf = lnk.ExtraBlocks.Any(t => t.GetType().Name == "SpecialFolderDataBlock"); tsf.Should().BeFalse(); }
public void WinVistaLnk() { var winP = Path.Combine(WinVistaPath, "Windows Update.lnk"); var lnk = Lnk.LoadFile(winP); lnk.RelativePath.Should().Be(@"..\..\..\..\Windows\System32\wuapp.exe"); lnk.VolumeInfo.Should().NotBeNull(); lnk.VolumeInfo.DriveType.Should().Be(VolumeInfo.DriveTypes.DriveFixed); lnk.VolumeInfo.VolumeSerialNumber.Should().Be("D85CC709"); lnk.VolumeInfo.VolumeLabel.Should().Be("TestOS"); lnk.LocalPath.Should().Be(@"D:\Windows\System32\wuapp.exe"); var tdb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "TrackerDataBaseBlock") as TrackerDataBaseBlock; tdb?.VolumeDroid.Should().Be("545b5616-9d9b-4f68-8fc9-98b391eeee2c"); tdb?.FileDroid.Should().Be("a7bdf3f4-6a85-11db-b5ae-f1534be43d84"); tdb?.MacAddress.Should().Be("f1:53:4b:e4:3d:84"); tdb?.MachineId.Should().Be("lh-ixn3n2mx5l20"); tdb?.CreationTime.Year.Should().Be(2006); tdb?.CreationTime.Month.Should().Be(11); tdb?.CreationTime.Day.Should().Be(2); tdb?.CreationTime.Hour.Should().Be(15); tdb?.CreationTime.Minute.Should().Be(20); tdb?.CreationTime.Second.Should().Be(21); lnk.ExtraBlocks.Count.Should().Be(4); var tID = lnk.TargetIDs.Last(); tID.ExtensionBlocks.Count.Should().Be(1); tID.Value.Should().Be("wuapp.exe"); var b4 = tID.ExtensionBlocks.Last() as Beef0004; b4?.MFTInformation.MFTEntryNumber.Should().Be((ulong)39556); b4?.MFTInformation.MFTSequenceNumber.Should().Be(1); var tsf = lnk.ExtraBlocks.Single(t => t.GetType().Name == "SpecialFolderDataBlock") as SpecialFolderDataBlock; tsf?.SpecialFolderId.Should().Be(37); }
public void foobar() { // var ls = Directory.GetFiles(@"C:\Temp\ll"); // var ls = Directory.GetFiles(@"C:\Temp\llunknown"); // // foreach (var s in ls) // { // Debug.WriteLine(s); // var l = Lnk.LoadFile(s); // Debug.WriteLine(l); // } var ll = Lnk.LoadFile(@"D:\Sync\Jump lists and lnks\ITA_LNKs\ITA_Win10\Preferenze di lingua di Microsoft Office 2010._lnk"); Debug.WriteLine(ll); }
public void foobar() { // var ls = Directory.GetFiles(@"C:\Temp\ll"); // var ls = Directory.GetFiles(@"C:\Temp\llunknown"); // // foreach (var s in ls) // { // Debug.WriteLine(s); // var l = Lnk.LoadFile(s); // Debug.WriteLine(l); // } var ll = Lnk.LoadFile(@"C:\Temp\!Azure\UpdateCheck.lnk.448476763.DROPPED"); Debug.WriteLine(ll); }
public void foobar() { // var ls = Directory.GetFiles(@"C:\Temp\ll"); // var ls = Directory.GetFiles(@"C:\Temp\llunknown"); // // foreach (var s in ls) // { // Debug.WriteLine(s); // var l = Lnk.LoadFile(s); // Debug.WriteLine(l); // } var ll = Lnk.LoadFile(@"C:\temp\lnk\Shortcut to Psd BACKUP OF JPGs.lnk"); Debug.WriteLine(ll); // ll = Lnk.LoadFile(@"C:\Temp\1\12dc1ea8e34b5a6.automaticDestinations-ms\AppId_12dc1ea8e34b5a6_DirName_2.lnk"); // Debug.WriteLine(ll); }
public void WinXPProgramLnk() { var winxpProgram = Path.Combine(WinXpPath, "WordPad.lnk"); var lnk = Lnk.LoadFile(winxpProgram); lnk.RelativePath.Should().Be(@"..\..\..\..\..\Program Files\Windows NT\Accessories\wordpad.exe"); lnk.VolumeInfo.Should().NotBeNull(); lnk.VolumeInfo.DriveType.Should().Be(VolumeInfo.DriveTypes.DriveFixed); lnk.VolumeInfo.VolumeSerialNumber.Should().Be("E0F7E847"); lnk.VolumeInfo.VolumeLabel.Should().Be(""); lnk.LocalPath.Should().Be(@"C:\Program Files\Windows NT\Accessories\wordpad.exe"); var tdb = lnk.ExtraBlocks.Single(t => t.GetType().Name == "TrackerDataBaseBlock") as TrackerDataBaseBlock; tdb?.VolumeDroid.Should().Be("00000000-0000-0000-0000-000000000000"); tdb?.FileDroid.Should().Be("0a897547-b9e8-11e5-9ab2-ffbfe31cf845"); tdb?.MacAddress.Should().Be("ff:bf:e3:1c:f8:45"); tdb?.MachineId.Should().Be("xppro"); tdb?.CreationTime.Year.Should().Be(2016); tdb?.CreationTime.Month.Should().Be(1); tdb?.CreationTime.Day.Should().Be(13); tdb?.CreationTime.Hour.Should().Be(11); tdb?.CreationTime.Minute.Should().Be(23); tdb?.CreationTime.Second.Should().Be(16); lnk.ExtraBlocks.Count.Should().Be(2); var tID = lnk.TargetIDs.Last(); tID.ExtensionBlocks.Count.Should().Be(1); tID.Value.Should().Be("wordpad.exe"); var b4 = tID.ExtensionBlocks.Last() as Beef0004; b4?.MFTInformation.MFTEntryNumber.Should().Be(null); }
public void foobar() { // var ls = Directory.GetFiles(@"C:\Temp\ll"); // var ls = Directory.GetFiles(@"C:\Temp\llunknown"); // // foreach (var s in ls) // { // Debug.WriteLine(s); // var l = Lnk.LoadFile(s); // Debug.WriteLine(l); // } var ll = Lnk.LoadFile(@"C:\Temp\d31ced1e2c2ca447e08fdc33f92ea77bf498abaf1cbf83db9bf9904d0fe9740d"); Debug.WriteLine(ll); // ll = Lnk.LoadFile(@"C:\Temp\1\12dc1ea8e34b5a6.automaticDestinations-ms\AppId_12dc1ea8e34b5a6_DirName_2.lnk"); // Debug.WriteLine(ll); }
public void foobar() { // var ls = Directory.GetFiles(@"C:\Temp\ll"); // var ls = Directory.GetFiles(@"C:\Temp\llunknown"); // // foreach (var s in ls) // { // Debug.WriteLine(s); // var l = Lnk.LoadFile(s); // Debug.WriteLine(l); // } var ll = Lnk.LoadFile(@"/home/eric/Temp/Shortcut to Edited.lnk.notlnk"); Console.WriteLine(ll); // ll = Lnk.LoadFile(@"C:\Temp\1\12dc1ea8e34b5a6.automaticDestinations-ms\AppId_12dc1ea8e34b5a6_DirName_2.lnk"); // Debug.WriteLine(ll); }
public void foobar() { var foo = Lnk.LoadFile(@"C:\Temp\broke.lnk"); Debug.WriteLine(foo); }