47 lines
1.4 KiB
C
Raw Normal View History

2019-03-17 18:42:07 +03:00
#ifndef PE_H
#define PE_H
#include <QString>
struct LIB_META_INFO {
2019-03-17 20:16:48 +03:00
unsigned short mashine = 0x0;
unsigned short type = 0x0;
unsigned int addressImports = 0x0;
unsigned int sizeImportTable = 0x0;
};
2019-03-17 18:42:07 +03:00
2019-03-17 20:16:48 +03:00
class PE {
2019-03-17 18:42:07 +03:00
2019-03-17 20:16:48 +03:00
private:
bool fillMetaInfo(LIB_META_INFO& info, const QString &file);
2019-03-17 18:42:07 +03:00
public:
enum class MashineTypesS: unsigned short {
IMAGE_FILE_MACHINE_UNKNOWN = 0x0,
IMAGE_FILE_MACHINE_AMD64 = 0x8664, // x64
IMAGE_FILE_MACHINE_ARM = 0x1c0, // ARM little endian
IMAGE_FILE_MACHINE_ARM64 = 0xaa64, // ARM64 little endian
IMAGE_FILE_MACHINE_ARMNT = 0x1c4, // ARM Thumb-2 little endian
IMAGE_FILE_MACHINE_I386 = 0x14c, // Intel 386 or later processors and compatible processors
};
enum class RunType: unsigned short {
_UNKNOWN = 0x0,
_32bit = 0x10B,
_64bit = 0x20B,
_ROM = 0x107,
};
constexpr static unsigned int PE_MAGIC = 0x00004550;
constexpr static unsigned int INDEX_PE_MAGIC = 0x80;
2019-03-17 20:16:48 +03:00
constexpr static unsigned int INDEX_MAGIC = INDEX_PE_MAGIC + 0x16;
constexpr static unsigned int INDEX_IMPORTS_32 = INDEX_MAGIC + 0x68;
constexpr static unsigned int INDEX_IMPORTS_64 = INDEX_MAGIC + 0x78;
2019-03-17 18:42:07 +03:00
bool is32bit(const QString& file);
bool dependecies(QStringList& lisr, const QString& file);
PE();
};
#endif // PE_H