mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 02:04:33 +00:00
added winApi pool
This commit is contained in:
parent
281abb3921
commit
9429b1acc8
@ -501,19 +501,19 @@ void ConfigParser::initIgnoreList()
|
||||
// win and core libs : see https://en.wikipedia.org/wiki/Microsoft_Windows_library_files
|
||||
_config.ignoreList.addRule(addRuleWin("Hal.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("NTDLL.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("KERNEL32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("GDI32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("USER32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("COMCTL32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("COMDLG32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("WS2_32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("ADVAPI32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("NETAPI32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("OLE32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("SHSCRAP.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("WINMM.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("IMM32.DLL"));
|
||||
// _config.ignoreList.addRule(addRuleWin("KernelBase.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("KERNEL32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("GDI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("USER32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("COMCTL32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("COMDLG32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("WS2_32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("ADVAPI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("NETAPI32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("OLE32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("SHSCRAP.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("WINMM.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("IMM32.DLL"));
|
||||
_config.ignoreList.addRule(addRuleWin("KernelBase.DLL"));
|
||||
|
||||
}
|
||||
|
||||
|
@ -139,6 +139,8 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res) {
|
||||
|
||||
void DependenciesScanner::setEnvironment(const QStringList &env) {
|
||||
QDir dir;
|
||||
|
||||
QSet<QString> winAPI;
|
||||
for (auto i : env) {
|
||||
|
||||
dir.setPath(i);
|
||||
@ -151,11 +153,17 @@ void DependenciesScanner::setEnvironment(const QStringList &env) {
|
||||
QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden);
|
||||
|
||||
for (auto i : list) {
|
||||
if (i.fileName().contains(APU_MS_WIN , Qt::CaseInsensitive)) {
|
||||
winAPI.insert(i.fileName().toUpper());
|
||||
}
|
||||
|
||||
_EnvLibs.insertMulti(i.fileName().toUpper(), i.absoluteFilePath());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_peScaner.setWinApiPlugins(winAPI);
|
||||
|
||||
}
|
||||
|
||||
QSet<LibInfo> DependenciesScanner::scan(const QString &path) {
|
||||
|
@ -60,6 +60,10 @@ void LibInfo::addDependncies(const QString &value) {
|
||||
dependncies.insert(value);
|
||||
}
|
||||
|
||||
void LibInfo::addDependncies(const QSet<QString> &value) {
|
||||
dependncies += value;
|
||||
}
|
||||
|
||||
void LibInfo::removeDependncies(const QString &value) {
|
||||
dependncies.remove(value);
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public:
|
||||
QSet<QString> getDependncies() const;
|
||||
void setDependncies(const QSet<QString> &value);
|
||||
void addDependncies(const QString &value);
|
||||
void addDependncies(const QSet<QString> &value);
|
||||
void removeDependncies(const QString &value);
|
||||
|
||||
LibPriority getPriority() const;
|
||||
|
@ -65,6 +65,10 @@ bool PE::getDep(peparse::parsed_pe_internal * internal, LibInfo &res) const {
|
||||
}
|
||||
}
|
||||
|
||||
if (res.getName().contains(APU_MS_WIN, Qt::CaseInsensitive)) {
|
||||
res.addDependncies(_apimswin);
|
||||
}
|
||||
|
||||
return res.getDependncies().size() || !imports.size();
|
||||
}
|
||||
|
||||
@ -72,6 +76,10 @@ PE::PE(): IGetLibInfo () {
|
||||
|
||||
}
|
||||
|
||||
void PE::setWinApiPlugins(const QSet<QString> &keys) {
|
||||
_apimswin = keys;
|
||||
}
|
||||
|
||||
bool PE::getLibInfo(const QString &lib, LibInfo &info) const {
|
||||
auto parsedPeLib = peparse::ParsePEFromFile(lib.toLatin1());
|
||||
|
||||
|
10
Deploy/pe.h
10
Deploy/pe.h
@ -13,6 +13,8 @@
|
||||
#include <QVector>
|
||||
#include "igetlibinfo.h"
|
||||
|
||||
#define APU_MS_WIN "api-ms-win"
|
||||
|
||||
namespace peparse {
|
||||
struct parsed_pe_internal;
|
||||
}
|
||||
@ -22,6 +24,8 @@ private:
|
||||
|
||||
bool getDep(peparse::parsed_pe_internal *, LibInfo &res) const;
|
||||
|
||||
QSet<QString> _apimswin;
|
||||
|
||||
public:
|
||||
|
||||
enum class RunType: unsigned short {
|
||||
@ -32,6 +36,12 @@ public:
|
||||
};
|
||||
PE();
|
||||
|
||||
/**
|
||||
* @brief setWinApiPlugins
|
||||
* @param keys set values of api-ms-win libs
|
||||
*/
|
||||
void setWinApiPlugins(const QSet<QString>& keys);
|
||||
|
||||
bool getLibInfo(const QString& lib, LibInfo& info) const override;
|
||||
|
||||
~PE() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user