i saw in pe-tutorial about import table, and i want to know about resource table.

for example i want to know that where is icon of exe file in it?
Posted on 2002-12-20 04:19:14 by hamed_hhz
Resource format in the PE file is undocumented. Ask Ewayne or me about it. :grin: Mostly what I know is wadding through Ewayne's source and looking at files in Hexeditor. Feel free to ask anything

To find the icon resource in the PE file,

1. Look through the Optional Header and enter the IMAGE_RESOURCE_DIRECTORY.
2. Extract the NumberofIDEntry and compare it with 3(Icon)
3. Look into the NumberofIDEntry and the NumberofNamedEntry and get the ID or name of the resource
4. Look into the NumberofIDEntry and the NumberofNamedEntry and get the Language
5. Now you have the size and address to the resource.
Posted on 2002-12-20 22:05:45 by roticv
thanks for your help

but i need more information. i find resource table address but i can't continue.

i want needed structure.

thanks
Posted on 2002-12-21 02:52:46 by hamed_hhz
Hi

Search for "res" or "ico" or "cur" at www.wotsit.org for a start. Use a PE explorer such as PEBrowsePro (Russell Osterlund) or Peridump (Jeremy Collake) and study a target program like notepad or your own example and compare in a hex editor. Learn how the rsrc section headers and binaries are structured in a "tree" format and you'll be well on your way to understanding the resource structure.

Besides, most of the major PE format documentations (Pietrek, Luevelsmeyer, O'Leary, Kath) explain the rsrc structure fully.

Kayaker
Posted on 2002-12-21 06:17:13 by Kayaker
but i need more information. i find resource table address but i can't continue.


You mean you found the resource table entry of the language, ID or the address to the resource?

The format the resource is in is really undocumentated, the O'Leary PE on that topic is outdated (It did not even describe MenuEx and stufffs like that).
Posted on 2002-12-21 07:47:34 by roticv
Granted the O'Leary and other docs only cover the general structure of the resource format, there is another excellent doc that details the individual resource types in depth. I'm sure many here have heard of it, Win32 Binary Resource Formats by Floyd Rogers, the file is called resfmt.txt and I believe can also be found at wotsit. Written in '99 it still seems to cover most of the currently used Resources, Controls and Statements described by MSDN, with the exception of MenuEx and possibly a few others.

That aside, if you were talking about Ewayne's ResEdit earlier, there's no question this is excellent work and there's much to be learned from the sources, along with his Control Builder programs and other accomplishments of course. That's the great thing about this board, the free sharing of sources, wonderful stuff!

Regards,
Kayaker
Posted on 2002-12-21 21:00:35 by Kayaker
Written in '99 it still seems to cover most of the currently used Resources, Controls and Statements described by MSDN, with the exception of MenuEx and possibly a few others.


I have yet to see the 99 verison... can post the link? All i have is the '93 verison...
Posted on 2002-12-22 01:36:55 by roticv
Sure. Might be the same version but here's the copy I have.
Posted on 2002-12-22 02:03:56 by Kayaker
It is abit outdated :grin: But that's the only document on resource
Posted on 2002-12-22 06:05:47 by roticv