News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to deal with RECORD directive

Started by ramguru, December 23, 2005, 01:42:35 PM

Previous topic - Next topic

ramguru

I decided to dig into PE resource section instead of using particular APIs. Now I'm supposed to use struct IMAGE_RESOURCE_DIRECTORY_ENTRY and don't know how to access its members (check if bit is set and so on). I've read documentation but it's too vague for me :) I need one example to get it clear. Of cource I can convert structure to other format, but this isn't a way to learn new things...

IMAGE_RESOURCE_DIRECTORY_ENTRY STRUCT
    union
        rName RECORD NameIsString:1,NameOffset:31
        Name1 dd ?
        Id dw ?
    ends
    union
        OffsetToData dd ?
rDirectory RECORD DataIsDirectory:1,OffsetToDirectory:31
    ends
IMAGE_RESOURCE_DIRECTORY_ENTRY ENDS

GregL


ramguru

Thanks...
...not exactly what I was expecting (I mean it looks a little primitive)
but I see here a few disadvantages like you have to have whole object (which will be devided into bits)
but  "mov    eax,(IMAGE_RESOURCE_DIRECTORY_ENTRY ptr [esi]).rDirectory" dosn't work :(
       "and    eax, MASK DataIsDirectory" seems to work
Now I have a doubt: would it be quicker not to use record, but instead check bits I need to check myself