Esempio n. 1
0
        /// <summary>Получить список всех поддиректорий к текущей директории</summary>
        /// <returns>Список поддиректорий</returns>
        public IEnumerator <ResourceDirectory> GetEnumerator()
        {
            var root = this.Directory;

            if (root.HasValue && root.Value.ContainsEntries)
            {
                UInt32 directorySize = ResourceDirectory.DirectorySize;
                UInt32 size          = ResourceDirectory.DirectoryEntrySize;

                for (UInt16 loop = 0; loop < root.Value.NumberOfEntries; loop++)
                {
                    UInt32 padding = this.Root.Directory.VirtualAddress + directorySize + this.DirectoryEntry.DirectoryAddress + (size * loop);
                    WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY result = this.Root.Parent.Header.PtrToStructure <WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY>(padding);
                    yield return(new ResourceDirectory(result, this.Root, this));
                }
            }
        }
Esempio n. 2
0
        /// <summary>Get recource directories from image direstory</summary>
        /// <returns>Resourec directories</returns>
        public IEnumerator <ResourceDirectory> GetEnumerator()
        {
            var root = this.Header;

            if (root.HasValue && root.Value.ContainsEntries)
            {
                UInt32 sizeOfStruct = ResourceDirectory.DirectoryEntrySize;

                UInt32 padding = base.Directory.VirtualAddress + ResourceDirectory.DirectorySize;
                for (UInt16 loop = 0; loop < root.Value.NumberOfEntries; loop++)
                {
                    WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY entry = base.Parent.Header.PtrToStructure <WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY>(padding);
                    padding += sizeOfStruct;
                    yield return(new ResourceDirectory(entry, this));
                }
            }
        }
Esempio n. 3
0
 /// <summary>Create instance of resource directory class</summary>
 /// <param name="entry">Directory description</param>
 /// <param name="root">PE directory</param>
 /// <param name="parent">Parent directory</param>
 public ResourceDirectory(WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY entry, Resource root, ResourceDirectory parent)
 {
     this._entry  = entry;
     this._root   = root;
     this._parent = parent;
 }
Esempio n. 4
0
 /// <summary>Create instance of resource root directory class</summary>
 /// <param name="entry">Directory description</param>
 /// <param name="root">PE directory</param>
 public ResourceDirectory(WinNT.Resource.IMAGE_RESOURCE_DIRECTORY_ENTRY entry, Resource root)
     : this(entry, root, null)
 {
 }