access PE headers in winelib shared library

Eric Pouech pouech-eric at wanadoo.fr
Wed Nov 17 12:50:34 CST 2004


Steven Edwards a écrit :
> Hi,
> 
> --- Jia L Wu <jwu at cc.helsinki.fi> wrote:
> 
>>Can somebody provide some example or information on how to
>>access PE headers(e.g. PIMAGE_DOS_HEADER, PIMAGE_NT_HEADER) wrapped
>>in
>>winelib shared library(e.g. winelib dll)? Thanks a lot!
> 
> 
> You might be able to do it using the imagehlp or version apis.
there are in fact two options, none works out of the box.

Either use imagehlp (or dbghelp) to get this information. Be aware that if 
you're using a mixed native/builtin setup, Wine will decide (from its settings) 
which DLL (native / builtin it's going to use). This will only work as a Winelib 
application.

Second option, is to extend winedump to handle ELF binaries. Look up from the 
nt_header symbol, then print out the strcuture. It's the same as what you'd find 
as a PE header, only the RVAs are computed differently (here you get the 
absolute address).

A+



More information about the wine-devel mailing list