Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
                }
            };
        }
Ejemplo n.º 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;
                }
            };
        }