Class ResourceDirectoryEntry

  • All Implemented Interfaces:
    StructConverter

    public class ResourceDirectoryEntry
    extends java.lang.Object
    implements StructConverter
     typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
         union {
             struct {
                 DWORD NameOffset:31;
                 DWORD NameIsString:1;
             };
             DWORD   Name;
             WORD    Id;
         };
         union {
             DWORD   OffsetToData;
             struct {
                 DWORD   OffsetToDirectory:31;
                 DWORD   DataIsDirectory:1;
             };
         };
     };
     
    • Constructor Detail

      • ResourceDirectoryEntry

        public ResourceDirectoryEntry​(FactoryBundledWithBinaryReader reader,
                                      int index,
                                      int resourceBase,
                                      boolean isNameEntry,
                                      boolean isFirstLevel,
                                      NTHeader ntHeader)
                               throws java.io.IOException
        Constructor.
        Parameters:
        reader - the binary reader
        index - the index where this directory begins
        Throws:
        java.io.IOException
    • Method Detail

      • getResources

        public java.util.List<ResourceInfo> getResources​(int level)
      • isNameEntry

        public boolean isNameEntry()
        Returns true if the parent resource directory is named, false indicates an ID.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getNameOffset

        public int getNameOffset()
        Returns the offset to the name of this resource.
        Returns:
        the offset to the name of this resource
        See Also:
        getName()
      • getNameIsString

        public boolean getNameIsString()
        Returns the ID of the name of this resource.
        Returns:
        the ID of the name of this resource
        See Also:
        getName()
      • getName

        public int getName()
        Returns:
        either an integer ID or a pointer to a structure that contains a string name
      • getId

        public int getId()
        Returns a resource ID.
        Returns:
        a resource ID
        See Also:
        getName()
      • getOffsetToData

        public int getOffsetToData()
        Returns:
        either an offset to another resource directory or a pointer to information about a specific resource instance
      • getOffsetToDirectory

        public int getOffsetToDirectory()
        Returns an offset to another resource directory.
        Returns:
        an offset to another resource directory
        See Also:
        getOffsetToData()
      • getDataIsDirectory

        public boolean getDataIsDirectory()
        Returns a pointer to information about a specific resource instance.
        Returns:
        a pointer to information about a specific resource instance
        See Also:
        getOffsetToData()
      • toDataType

        public DataType toDataType()
                            throws DuplicateNameException,
                                   java.io.IOException
        Description copied from interface: StructConverter
        Returns a structure datatype representing the contents of the implementor of this interface.

        For example, given:

         class A {
             int foo;
             double bar;
         }
         

        The return value should be a structure data type with two data type components; an INT and a DOUBLE. The structure should contain field names and, if possible, field comments.

        Specified by:
        toDataType in interface StructConverter
        Returns:
        returns a structure datatype representing the implementor of this interface
        Throws:
        DuplicateNameException - when a datatype of the same name already exists
        java.io.IOException
        See Also:
        StructureDataType
      • isValid

        public boolean isValid()