Exemplo n.º 1
0
 internal DataDirectory(DataDirectoryName name, Section targetSection, uint headerOffset, Structures.IMAGE_DATA_DIRECTORY rawDataDir)
 {
     this._name = name;
     this._headerOffset = headerOffset;
     this._rawDataDir = rawDataDir;
     if (rawDataDir.RVA == 0 || targetSection == null)
     {
         _targetOffset = new Offset(0, 0, 0);
     }
     else
     {
         this._targetOffset = Offset.FromRva(rawDataDir.RVA, targetSection.ParentAssembly);
         this._targetSection = targetSection;
     }
 }
Exemplo n.º 2
0
        internal DataDirectory(DataDirectoryName name, Section[] assemblySections, uint offset, Structures.IMAGE_DATA_DIRECTORY rawDataDir)
        {
            this._rawDataDir = rawDataDir;
            this._name = name;
            if (rawDataDir.RVA == 0)
            {
                _targetOffset = new Offset(0, 0, 0);
            }
            else
            {
                this._headerOffset = offset;

                _targetSection = Section.GetSectionByRva(assemblySections, rawDataDir.RVA);
                if (_targetSection == null)
                    this.TargetOffset = new Offset(0, rawDataDir.RVA, 0);
                else
                    this._targetOffset = Offset.FromRva(rawDataDir.RVA, assemblySections[0].ParentAssembly);
            }
        }