private bool ParseJumpList(string JumpListFilePath) { this.DestListObj = new DestList(); JumpListFile JumpListFileObj = new JumpListFile { FilePath = JumpListFilePath, FileName = System.IO.Path.GetFileName(JumpListFilePath) }; CompoundFile JumpListFileCompound = new CompoundFile(JumpListFilePath); CFStream JumpListDestListStream = JumpListFileCompound.RootStorage.GetStream("DestList"); JumpListFileObj.DestListSize = JumpListDestListStream.Size; List<DestListEntry> JumpListEntries = this.ParseDestList(JumpListDestListStream.GetData()); JumpListFileObj.DestListEntries = JumpListEntries; List<DestListEntry> JumpListEntriesToRemove = new List<DestListEntry>(); foreach (DestListEntry JumpListEntry in JumpListEntries) { CFStream JumpListEntryStream = null; bool err = false; try { try { JumpListEntryStream = JumpListFileCompound.RootStorage.GetStream(JumpListEntry.StreamNo); } catch (OpenMcdf.CFItemNotFound e) { this.ScrubberGUIInst.DebugPrint("Error (JumpList): List seems empty. List: " + JumpListFilePath + " StreamNo: " + JumpListEntry.StreamNo); JumpListFileCompound.Close(); JumpListEntriesToRemove.Add(JumpListEntry); err = true; continue; } JumpList JumpListObj = new JumpList { Name = JumpListEntry.StreamNo, Size = JumpListEntryStream.GetData().Length, DestListEntry = JumpListEntry }; JumpListFileObj.JumpLists.Add(JumpListObj); this.JumpListFiles = JumpListFileObj; if (!err) { JumpListFileObj.JumpLists.Add(JumpListObj); } this.JumpListFiles = JumpListFileObj; } catch (Exception e) { this.ScrubberGUIInst.DebugPrint(e.ToString()); continue; } }JumpListFileCompound.Close(); foreach (DestListEntry JumpListEntry in JumpListEntriesToRemove) { JumpListEntries.Remove(JumpListEntry); JumpListFileObj.DestListEntries.Remove(JumpListEntry); //File.Delete(JumpListFilePath); } if (JumpListEntries.Count == 0) return false; this._jumpListFiles.Add(JumpListFileObj); return true; }
private void InitalizeVariables() { numPositionToName = new Dictionary<short, string>(); numPositionToName.Add(1, "Header"); numPositionToName.Add(2, "ToUnknownP"); //recurse starts here numPositionToName.Add(3, "ToPadding1"); numPositionToName.Add(4, "NetBIOS"); numPositionToName.Add(5, "StreamNo"); numPositionToName.Add(6, "ToPadding2"); numPositionToName.Add(7, "FileTime"); numPositionToName.Add(8, "ToPadding3"); numPositionToName.Add(9, "PathLength"); numPositionToName.Add(10, "FilePath"); positionsRelative = new Dictionary<short, long>(); positionsRelative.Add(1, 0x00L); positionsRelative.Add(2, 0x20L); //recurse starts here positionsRelative.Add(3, 0x08L); positionsRelative.Add(4, 0x40L); positionsRelative.Add(5, 0x10L); positionsRelative.Add(6, 0x08L); positionsRelative.Add(7, 0x04L); positionsRelative.Add(8, 0x08L); positionsRelative.Add(9, 0x04L); positionsRelative.Add(10, 0x02L); positionsAbsolute = new Dictionary<short, long>(); positionsAbsolute.Add(1, 0x00L); positionsAbsolute.Add(2, 0x20L); //recurse starts here positionsAbsolute.Add(3, 0x28L); positionsAbsolute.Add(4, 0x68L); positionsAbsolute.Add(5, 0x78L); positionsAbsolute.Add(6, 0x80L); positionsAbsolute.Add(7, 0x84L); positionsAbsolute.Add(8, 0x8CL); positionsAbsolute.Add(9, 0x90L); positionsAbsolute.Add(10, 0x92L); matches = new List<long>(); _jumpListFiles = new List<JumpListFile>(); DestListObj = new DestList(); }