-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathxformats.h
executable file
·67 lines (63 loc) · 3.14 KB
/
xformats.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
/* 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 XFORMATS_H
#define XFORMATS_H
#include "xbinary.h"
#include "xcom.h"
#include "xmsdos.h"
#include "xne.h"
#include "xle.h"
#include "xpe.h"
#include "xelf.h"
#include "xmach.h"
#ifdef USE_DEX
#include "xdex.h"
#include "xandroidbinary.h"
#endif
#ifdef USE_ARCHIVE
#include "xarchives.h"
#endif
#ifdef QT_GUI_LIB
#include <QComboBox> // TODO Check TESTLIB !!!
#endif
class XFormats : public QObject
{
Q_OBJECT
public:
explicit XFormats(QObject *pParent=nullptr);
static XBinary::_MEMORY_MAP getMemoryMap(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static qint64 getEntryPointAddress(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static qint64 getEntryPointOffset(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static bool isBigEndian(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static bool isSigned(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static bool isSigned(QString sFileName);
static XBinary::OFFSETSIZE getSignOffsetSize(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);
static XBinary::OFFSETSIZE getSignOffsetSize(QString sFileName);
static QList<XBinary::SYMBOL_RECORD> getSymbolRecords(XBinary::FT fileType,QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1,XBinary::SYMBOL_TYPE symBolType=XBinary::SYMBOL_TYPE_ALL);
static QSet<XBinary::FT> getFileTypes(QIODevice *pDevice,bool bExtra=false);
static QSet<XBinary::FT> getFileTypes(QString sFileName,bool bExtra=false);
#ifdef QT_GUI_LIB
static XBinary::FT setFileTypeComboBox(XBinary::FT fileType,QIODevice *pDevice,QComboBox *pComboBox);
static XBinary::FT setFileTypeComboBox(QString sFileName,QComboBox *pComboBox);
static bool setEndianessComboBox(QComboBox *pComboBox,bool bIsBigEndian);
#endif
};
#endif // XFORMATS_H