-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathxne.h
144 lines (130 loc) · 5.66 KB
/
xne.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* Copyright (c) 2020-2021 hors<horsicq@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef XNE_H
#define XNE_H
#include "xmsdos.h"
#include "xne_def.h"
class XNE : public XMSDOS
{
Q_OBJECT
public:
enum TYPE
{
TYPE_UNKNOWN=0,
TYPE_EXE,
TYPE_DLL,
TYPE_DRIVER
// TODO Check More
};
explicit XNE(QIODevice *pDevice=nullptr,bool bIsImage=false,qint64 nModuleAddress=-1);
virtual bool isValid();
static bool isValid(QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static MODE getMode(QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
qint64 getImageOS2HeaderOffset();
qint64 getImageOS2HeaderSize();
XNE_DEF::IMAGE_OS2_HEADER getImageOS2Header();
quint16 getImageOS2Header_magic();
quint8 getImageOS2Header_ver();
quint8 getImageOS2Header_rev();
quint16 getImageOS2Header_enttab();
quint16 getImageOS2Header_cbenttab();
quint32 getImageOS2Header_crc();
quint16 getImageOS2Header_flags();
quint16 getImageOS2Header_autodata();
quint16 getImageOS2Header_heap();
quint16 getImageOS2Header_stack();
quint32 getImageOS2Header_csip();
quint32 getImageOS2Header_sssp();
quint16 getImageOS2Header_cseg();
quint16 getImageOS2Header_cmod();
quint16 getImageOS2Header_cbnrestab();
quint16 getImageOS2Header_segtab();
quint16 getImageOS2Header_rsrctab();
quint16 getImageOS2Header_restab();
quint16 getImageOS2Header_modtab();
quint16 getImageOS2Header_imptab();
quint32 getImageOS2Header_nrestab();
quint16 getImageOS2Header_cmovent();
quint16 getImageOS2Header_align();
quint16 getImageOS2Header_cres();
quint8 getImageOS2Header_exetyp();
quint8 getImageOS2Header_flagsothers();
quint16 getImageOS2Header_pretthunks();
quint16 getImageOS2Header_psegrefbytes();
quint16 getImageOS2Header_swaparea();
quint16 getImageOS2Header_expver();
void setImageOS2Header_magic(quint16 nValue);
void setImageOS2Header_ver(quint8 nValue);
void setImageOS2Header_rev(quint8 nValue);
void setImageOS2Header_enttab(quint16 nValue);
void setImageOS2Header_cbenttab(quint16 nValue);
void setImageOS2Header_crc(quint32 nValue);
void setImageOS2Header_flags(quint16 nValue);
void setImageOS2Header_autodata(quint16 nValue);
void setImageOS2Header_heap(quint16 nValue);
void setImageOS2Header_stack(quint16 nValue);
void setImageOS2Header_csip(quint32 nValue);
void setImageOS2Header_sssp(quint32 nValue);
void setImageOS2Header_cseg(quint16 nValue);
void setImageOS2Header_cmod(quint16 nValue);
void setImageOS2Header_cbnrestab(quint16 nValue);
void setImageOS2Header_segtab(quint16 nValue);
void setImageOS2Header_rsrctab(quint16 nValue);
void setImageOS2Header_restab(quint16 nValue);
void setImageOS2Header_modtab(quint16 nValue);
void setImageOS2Header_imptab(quint16 nValue);
void setImageOS2Header_nrestab(quint32 nValue);
void setImageOS2Header_cmovent(quint16 nValue);
void setImageOS2Header_align(quint16 nValue);
void setImageOS2Header_cres(quint16 nValue);
void setImageOS2Header_exetyp(quint8 nValue);
void setImageOS2Header_flagsothers(quint8 nValue);
void setImageOS2Header_pretthunks(quint16 nValue);
void setImageOS2Header_psegrefbytes(quint16 nValue);
void setImageOS2Header_swaparea(quint16 nValue);
void setImageOS2Header_expver(quint16 nValue);
qint64 getEntryTableOffset();
qint64 getEntryTableSize();
qint64 getSegmentTableOffset();
qint64 getResourceTableOffset();
qint64 getResidentNameTableOffset();
qint64 getModuleReferenceTableOffset();
qint64 getImportedNamesTableOffset();
qint64 getNotResindentNameTableOffset();
QList<XNE_DEF::NE_SEGMENT> getSegmentList();
XNE_DEF::NE_SEGMENT _read_NE_SEGMENT(qint64 nOffset);
static QMap<quint64,QString> getImageNEMagics();
static QMap<quint64,QString> getImageNEMagicsS();
static QMap<quint64,QString> getImageNEFlagsS();
static QMap<quint64,QString> getImageNEExetypesS();
static QMap<quint64,QString> getImageNEFlagsothersS();
static QMap<quint64,QString> getImageSegmentTypesS();
virtual _MEMORY_MAP getMemoryMap();
virtual MODE getMode();
virtual QString getArch();
virtual bool isBigEndian();
virtual qint64 getEntryPointOffset(_MEMORY_MAP *pMemoryMap);
virtual FT getFileType();
virtual qint32 getType();
virtual OSINFO getOsInfo();
virtual QString typeIdToString(int nType);
};
#endif // XNE_H