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
ramguru,
This might help, it's an example I wrote that uses RECORD and MASK.
http://www.masmforum.com/simple/index.php?topic=975.msg7490#msg7490
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