コード例 #1
0
ファイル: JumpListCleaner.cs プロジェクト: solbirn/Scrubber
        private List<DestListEntry> ParseDestList(byte[] data)
        {
            List<DestListEntry> JumpListDestListEntries = new List<DestListEntry>();
            try
            {
                using (MemoryStream JumpListEntriesStream = new MemoryStream(data))
                {

                    JumpListEntriesStream.Read(this.DestListObj.Header, 0x0, 0x20);
                    do
                    {
                        DestListEntry JumpListDestListEntry = new DestListEntry();
                        JumpListDestListEntry.EntryPosition = JumpListEntriesStream.Position;
                        JumpListEntriesStream.Seek(0x48L, SeekOrigin.Current);
                        JumpListDestListEntry.NetBiosName = StreamHelper.ReadStr(JumpListEntriesStream, 0x10).Replace("\0", "");//Text.ReplaceNulls(StreamReaderHelper.ReadString(JumpListEntriesStream, 0x10));
                        JumpListDestListEntry.StreamNoInt = StreamHelper.Read64(JumpListEntriesStream);
                        JumpListDestListEntry.StreamNo = JumpListDestListEntry.StreamNoInt.ToString("X");
                        JumpListEntriesStream.Seek(4L, SeekOrigin.Current);
                        JumpListDestListEntry.FileTime = StreamHelper.ReadDateTime(JumpListEntriesStream);
                        JumpListEntriesStream.Seek(4L, SeekOrigin.Current);
                        int num = StreamHelper.Read16(JumpListEntriesStream);
                        if (num != -1)
                        {
                            JumpListDestListEntry.Data = StreamHelper.ReadStrU(JumpListEntriesStream, num * 2);
                        }
                        else
                        {
                            JumpListEntriesStream.Seek(4L, SeekOrigin.Current);
                        }
                        JumpListDestListEntry.Data = this.ReplaceNulls(JumpListDestListEntry.Data);
                        JumpListDestListEntry.EntrySize = JumpListEntriesStream.Position - JumpListDestListEntry.EntryPosition;
                        JumpListDestListEntry.RawData = new byte[JumpListDestListEntry.EntrySize];
                        using (MemoryStream JumpListDestListStreamForSave = new MemoryStream(data))
                        {
                            JumpListDestListStreamForSave.Seek(JumpListDestListEntry.EntryPosition, SeekOrigin.Begin);
                            JumpListDestListStreamForSave.Read(JumpListDestListEntry.RawData, 0x0, (int)JumpListDestListEntry.EntrySize);
                        }
                        JumpListDestListEntries.Add(JumpListDestListEntry);
                    }
                    while (JumpListEntriesStream.Position < JumpListEntriesStream.Length);
                }
            }
            catch (Exception e)
            {
                this.ScrubberGUIInst.DebugPrint(e.ToString());
                return JumpListDestListEntries;
            }
            return JumpListDestListEntries;
        }
コード例 #2
0
ファイル: JumpListCleaner.cs プロジェクト: solbirn/Scrubber
 private void DebugLogDestListEntry(DestListEntry dle)
 {
     File.WriteAllBytes(dle.StreamNo + ".log", dle.RawData);
 }