I want to read the names of the resources. For example, in the DIALOG resource tree I want to read the string "MyDialog" or whatever. I can't understand the resource structure

IMAGE_RESOURCE_DIRECTORY_ENTRY
union
rName RECORD NameIsString:1,NameOffset:31
Name1 dd ?
Id dw ?
ends

I can't figure out what RECORD means and how to use it, and the masm help was not very clear for me..maybe because my english is poor. I also searched the forum/net for similar topics, but found none
Some code which will clear this for me would be great

Thanks
Posted on 2002-08-27 10:10:51 by DZA
this means:

IMAGE_RESOURCE_DIRECTORY_ENTRY struc
irde_Name dd ?
irde_OffsetToData dd ?
IMAGE_RESOURCE_DIRECTORY_ENTRY ends

where name is either an ID number (between 0..65536) or an offset to a
string. If its a string, bit 31 is set, otherwise the bit 31 is zero.
This supports the windows method to name resources with numbers or strings.
The second DWORD points to the real data.

here is a comment from the original windows (C) include files:
;
; Each directory contains the 32-bit Name of the entry and an offset,
; relative to the beginning of the resource directory of the data associated
; with this directory entry.If the name of the entry is an actual text
; string instead of an integer Id, then the high order bit of the name field
; is set to one and the low order 31-bits are an offset, relative to the
; beginning of the resource directory of the string, which is of type
; IMAGE_RESOURCE_DIRECTORY_STRING.Otherwise the high bit is clear and the
; low-order 16-bits are the integer Id that identify this resource directory
; entry. If the directory entry is yet another resource directory (i.e. a
; subdirectory), then the high order bit of the offset field will be
; set to indicate this.Otherwise the high bit is clear and the offset
; field points to a resource data entry.
Posted on 2002-08-27 12:02:29 by beaster
Thanks..u made it clearer for me with the structure stuff, but the "offset" I get from Name1 seems invalid..and if the exe has Id resources, still the Id is not valid

mov edx, (IMAGE_RESOURCE_DATA_ENTRY ptr ).Name1
; now edx should contain Id or offset to name, right???

Please if someone could explain this for me with a code snippet or something because I really don't get it:/
Posted on 2002-08-28 04:39:06 by DZA
nm, I fixed the problem..there was an error in my browse resource tree loop
actually

Thanks
Posted on 2002-08-28 13:35:10 by DZA