コード例 #1
0
ファイル: PEFileModel.cs プロジェクト: BGCX261/zoompe-git
        public PEFileModel(string fileName, PEFile peFile)
            : base(new ObservableCollection <object>())
        {
            this.m_FileName = fileName;
            this.peFile     = peFile;

            this.m_DosHeader = new DosHeaderModel(peFile.DosHeader);
            this.Items.Add(this.DosHeader);

            UpdateDosStubFromlfanew();

            this.m_PEHeader = new PEHeaderModel(peFile.PEHeader, m_DosHeader);
            this.Items.Add(this.PEHeader);

            this.m_OptionalHeader = new OptionalHeaderModel(peFile.OptionalHeader, m_PEHeader);
            this.Items.Add(this.OptionalHeader);

            this.m_SectionHeaders = new SectionHeaderListModel(peFile, this.PEHeader, this.OptionalHeader);
            this.Items.Add(this.SectionHeaders);

            UpdateSectionContentParts();

            this.DosHeader.PropertyChanged += DosHeader_PropertyChanged;
            ((INotifyCollectionChanged)this.SectionHeaders.Items).CollectionChanged += SectionHeaders_Items_CollectionChanged;
        }
コード例 #2
0
        public SectionHeaderListModel(PEFile peFile, PEHeaderModel peHeader, OptionalHeaderModel optionalHeader)
            : base("Section headers")
        {
            this.peFile = peFile;

            this.m_Items = new ReadOnlyObservableCollection <SectionHeaderModel>(itemsCore);

            BindAddressToOptionalHeader(optionalHeader);
            BindToPEHeader(peHeader);
        }
コード例 #3
0
        public SectionHeaderListModel(PEFile peFile, PEHeaderModel peHeader, OptionalHeaderModel optionalHeader)
            : base("Section headers")
        {
            this.peFile = peFile;

            this.m_Items = new ReadOnlyObservableCollection<SectionHeaderModel>(itemsCore);

            BindAddressToOptionalHeader(optionalHeader);
            BindToPEHeader(peHeader);
        }
コード例 #4
0
        private void BindAddressToOptionalHeader(OptionalHeaderModel optionalHeader)
        {
            this.Address = optionalHeader.Address + optionalHeader.Length;

            optionalHeader.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Address" ||
                    e.PropertyName == "Length")
                {
                    this.Address = optionalHeader.Address + optionalHeader.Length;
                }
            };
        }
コード例 #5
0
        private void BindAddressToOptionalHeader(OptionalHeaderModel optionalHeader)
        {
            this.Address = optionalHeader.Address + optionalHeader.Length;

            optionalHeader.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName == "Address"
                    || e.PropertyName == "Length")
                {
                    this.Address = optionalHeader.Address + optionalHeader.Length;
                }
            };
        }