예제 #1
0
 public PEHeadersOptionsVM(Machine defaultMachine, Subsystem defaultSubsystem)
 {
     this.defaultMachine   = defaultMachine;
     this.defaultSubsystem = defaultSubsystem;
     Machine = new EnumListVM(machineList, (a, b) => {
         Characteristics = CharacteristicsHelper.GetCharacteristics(Characteristics ?? 0, (dnlib.PE.Machine)Machine.SelectedItem);
     });
     TimeDateStamp               = new NullableUInt32VM(a => HasErrorUpdated());
     PointerToSymbolTable        = new NullableUInt32VM(a => HasErrorUpdated());
     NumberOfSymbols             = new NullableUInt32VM(a => HasErrorUpdated());
     MajorLinkerVersion          = new NullableByteVM(a => HasErrorUpdated());
     MinorLinkerVersion          = new NullableByteVM(a => HasErrorUpdated());
     ImageBase                   = new NullableUInt64VM(a => HasErrorUpdated());
     SectionAlignment            = new NullableUInt32VM(a => HasErrorUpdated());
     FileAlignment               = new NullableUInt32VM(a => HasErrorUpdated());
     MajorOperatingSystemVersion = new NullableUInt16VM(a => HasErrorUpdated());
     MinorOperatingSystemVersion = new NullableUInt16VM(a => HasErrorUpdated());
     MajorImageVersion           = new NullableUInt16VM(a => HasErrorUpdated());
     MinorImageVersion           = new NullableUInt16VM(a => HasErrorUpdated());
     MajorSubsystemVersion       = new NullableUInt16VM(a => HasErrorUpdated());
     MinorSubsystemVersion       = new NullableUInt16VM(a => HasErrorUpdated());
     Win32VersionValue           = new NullableUInt32VM(a => HasErrorUpdated());
     SizeOfStackReserve          = new NullableUInt64VM(a => HasErrorUpdated());
     SizeOfStackCommit           = new NullableUInt64VM(a => HasErrorUpdated());
     SizeOfHeapReserve           = new NullableUInt64VM(a => HasErrorUpdated());
     SizeOfHeapCommit            = new NullableUInt64VM(a => HasErrorUpdated());
     LoaderFlags                 = new NullableUInt32VM(a => HasErrorUpdated());
     NumberOfRvaAndSizes         = new NullableUInt32VM(a => HasErrorUpdated());
 }
예제 #2
0
        public SaveModuleOptionsVM(IDsDocument document)
        {
            this.document      = document;
            Module             = document.ModuleDef;
            PEHeadersOptions   = new PEHeadersOptionsVM(Module.Machine, GetSubsystem(Module.Kind));
            Cor20HeaderOptions = new Cor20HeaderOptionsVM();
            MetaDataOptions    = new MetaDataOptionsVM();

            PEHeadersOptions.PropertyChanged   += (s, e) => HasErrorUpdated();
            Cor20HeaderOptions.PropertyChanged += (s, e) => HasErrorUpdated();
            MetaDataOptions.PropertyChanged    += (s, e) => HasErrorUpdated();

            ModuleKind = new EnumListVM(moduleKindList, (a, b) => {
                OnPropertyChanged(nameof(Extension));
                PEHeadersOptions.Subsystem.SelectedItem = GetSubsystem((dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
                PEHeadersOptions.Characteristics        = CharacteristicsHelper.GetCharacteristics(PEHeadersOptions.Characteristics ?? 0, (dnlib.DotNet.ModuleKind)ModuleKind.SelectedItem);
            });

            Reinitialize();
        }