1 | /* $Id: kFileLX.h,v 1.4 2001-02-02 08:45:41 bird Exp $
|
---|
2 | *
|
---|
3 | * kFileLX - Linear Executable file reader.
|
---|
4 | *
|
---|
5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | #ifndef _kFileLX_h_
|
---|
12 | #define _kFileLX_h_
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 | class kFileLX : public kFileFormatBase/*, public kPageI*/
|
---|
18 | {
|
---|
19 | protected:
|
---|
20 | PVOID pvBase; /* Pointer to filemapping. */
|
---|
21 | ULONG cbFile; /* Size of filemapping. */
|
---|
22 | ULONG offLXHdr; /* Offset of the LX header. */
|
---|
23 | struct e32_exe * pe32; /* Pointer to the exe header within the filemapping. */
|
---|
24 | struct o32_obj * paObject; /* Pointer to the objecttable. */
|
---|
25 | struct o32_map * paMap; /* Pointer to page map table. */
|
---|
26 |
|
---|
27 | BOOL queryExportName(int iOrdinal, char *pszBuffer);
|
---|
28 |
|
---|
29 | public:
|
---|
30 | kFileLX(const char *pszFilename) throw (int);
|
---|
31 | kFileLX(kFile *pFile) throw (int);
|
---|
32 | ~kFileLX();
|
---|
33 |
|
---|
34 | virtual BOOL queryModuleName(char *pszBuffer);
|
---|
35 | virtual BOOL findFirstExport(PEXPORTENTRY pExport);
|
---|
36 | virtual BOOL findNextExport(PEXPORTENTRY pExport);
|
---|
37 | virtual BOOL isLx() const {return TRUE;};
|
---|
38 |
|
---|
39 | struct o32_obj * getObject(int iObject);
|
---|
40 | int getObjectCount();
|
---|
41 |
|
---|
42 | #if 0
|
---|
43 | /** @cat Get and put page methods. (the first ones are generic) */
|
---|
44 | BOOL getPage(char *pachPage, ULONG ulAddress);
|
---|
45 | BOOL getPage(char *pachPage, int iObject, int offObject);
|
---|
46 | BOOL putPage(const char *pachPage, ULONG ulAddress);
|
---|
47 | BOOL putPage(const char *pachPage, int iObject, int offObject);
|
---|
48 |
|
---|
49 | BOOL getPageLX(char *pachPage, int iObject, int iPage);
|
---|
50 | BOOL getPageLX(char *pachPage, int iPage);
|
---|
51 | BOOL putPageLX(const char *pachPage, int iObject, int iPage);
|
---|
52 | BOOL putPageLX(const char *pachPage, int iPage);
|
---|
53 |
|
---|
54 | /** @cat Compression and expansion methods compatible with exepack:1 and exepack:2. */
|
---|
55 | static BOOL expandPage1(char *pachPage, const char * pachSrcPage, int cchSrcPage);
|
---|
56 | static BOOL expandPage2(char *pachPage, const char * pachSrcPage, int cchSrcPage);
|
---|
57 | static int compressPage1(char *pachPage, const char * pachSrcPage);
|
---|
58 | static int compressPage2(char *pachPage, const char * pachSrcPage);
|
---|
59 | #endif
|
---|
60 | };
|
---|
61 | #endif
|
---|