Ignore:
Timestamp:
Oct 14, 1999, 3:39:13 AM (26 years ago)
Author:
bird
Message:

New Pe2Lx implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/winimagepe2lx.h

    r953 r1274  
    1 /* $Id: winimagepe2lx.h,v 1.1 1999-09-15 23:29:37 sandervl Exp $ */
     1/* $Id: winimagepe2lx.h,v 1.2 1999-10-14 01:39:13 bird Exp $ */
    22
    33/*
     
    55 *
    66 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
    7  *
     7 * Copyright 1999 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    88 *
    99 * Project Odin Software License can be found in LICENSE.TXT
     
    1515#include <winimagebase.h>
    1616
    17 #define NO_NAMETABLE            0x77777777
    18 #define NO_LOOKUPTABLE          0x888888
    19 #define GET_CONSOLE(a)          (a >> 24)
    20 #define SET_CONSOLE(a)          (a << 24)
    2117
    22 #define RESID_CONVERTEDNAMES    63*1024
     18/**
     19 * Section struct - used to translate RVAs to pointers.
     20 */
     21typedef struct _Section
     22{
     23    ULONG ulRVA;            /* RVA of section. If not a PE section ~0UL. */
     24    ULONG cbVirtual;        /* Virtual size (the larger of the physical and virtual) of the section. */
     25    ULONG ulAddress;        /* Current load address of the section. */
     26} SECTION, *PSECTION;
    2327
    24 #pragma pack(1)
    25 typedef struct {
    26   int    id;
    27   char   name[1];
    28 } NameId;
    29 #pragma pack()
    3028
     29
     30/**
     31 * Base class for Pe2lx (and Win32k) dlls. There is currently no difference between
     32 * Pe2Lx and Win32k images, though the image on disk is different...
     33 * @shortdesc   Pe2Lx and Win32k base image class.
     34 * @author      knut st. osmundsen, Sander van Leeuwen
     35 * @approval    -
     36 */
    3137class Win32Pe2LxImage : public virtual Win32ImageBase
    3238{
    3339public:
    34          Win32Pe2LxImage(HINSTANCE hinstance, int NameTableId, int Win32TableId);
    35 virtual ~Win32Pe2LxImage();
     40    /** @cat constructor and destructor */
     41    Win32Pe2LxImage(HINSTANCE hinstance, BOOL fWin32k) throw(ULONG);
     42    virtual ~Win32Pe2LxImage();
    3643
    37 virtual HRSRC findResourceA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
    38 virtual ULONG getResourceSizeA(LPCSTR lpszName, LPSTR lpszType, ULONG lang = LANG_GETFIRST);
    39 
    40         void  setVersionId(int id) { VersionId = id;   };
    41 
    42 virtual ULONG getVersionSize();
    43 virtual BOOL  getVersionStruct(char *verstruct, ULONG bufLength);
     44private:
     45    /** @cat constructor helpers */
     46    ULONG    getSections();
     47    ULONG    setSectionRVAs();
     48    VOID     cleanup();
    4449
    4550protected:
    46         int   getWin32ResourceId(int id);
    47         int   convertNameId(char *lpszName);
     51    /** @cat RVA -> pointer */
     52    /* this should be moved to winimagebase some day... */
     53    PVOID    getPointerFromRVA(ULONG ulRVA);
    4854
    49         int   getVersionId()       { return VersionId; };
     55    PSECTION            paSections; /* Used by getPointerFromRVA and created by getSections and
     56                                     * setSectionRVAs. */
     57    WORD                cSections;  /* Count of entires in the section array (paSection) */
    5058
    51         int                   NameTableId;
    52         int                   Win32TableId;
    53         int                   VersionId;
     59    /** @cat Misc */
     60    PIMAGE_NT_HEADERS   pNtHdrs;    /* Pointer to NT headers. */
     61    BOOL                fWin32k;    /* flag which indicates wether this is a Win32k loaded
     62                                     * module (TRUE) or and Pe2Lx module (FALSE). */
     63};
    5464
    55         ULONG                *Win32Table;
    56         NameId               *NameTable;
    57 
    58 private:
    59 };
    6065
    6166#endif //__WINIMAGEPE2LX_H__
Note: See TracChangeset for help on using the changeset viewer.