Beispiel #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;
        }
Beispiel #2
0
        public PEHeaderModel(PEHeader peHeader, DosHeaderModel dosHeaderModel)
            : base("PE header")
        {
            this.peHeader = peHeader;

            this.Address = dosHeaderModel.lfanew;
            this.Length = PEHeader.Size;

            BindAddressToDosHeaderlfanew(dosHeaderModel);
        }
Beispiel #3
0
        public PEHeaderModel(PEHeader peHeader, DosHeaderModel dosHeaderModel)
            : base("PE header")
        {
            this.peHeader = peHeader;

            this.Address = dosHeaderModel.lfanew;
            this.Length  = PEHeader.Size;

            BindAddressToDosHeaderlfanew(dosHeaderModel);
        }
Beispiel #4
0
 private void BindAddressToDosHeaderlfanew(DosHeaderModel dosHeaderModel)
 {
     dosHeaderModel.PropertyChanged += (sender, e) =>
     {
         if (e.PropertyName == "lfanew")
         {
             this.Address = dosHeaderModel.lfanew;
         }
     };
 }
Beispiel #5
0
 private void BindAddressToDosHeaderlfanew(DosHeaderModel dosHeaderModel)
 {
     dosHeaderModel.PropertyChanged += (sender, e) =>
     {
         if (e.PropertyName == "lfanew")
             this.Address = dosHeaderModel.lfanew;
     };
 }