File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ find_package(Boost REQUIRED COMPONENTS system filesystem)
2525
2626find_package (OpenSSL REQUIRED)
2727
28- find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
29-
3028if (NOT EXISTS "${CMAKE_SOURCE_DIR} /libs/miniz/CMakeLists.txt" )
3129 message (STATUS "Submodule 'libs/miniz' not found. Updating submodules..." )
3230 execute_process (
@@ -126,7 +124,6 @@ set(LINK_COMMON
126124 OpenSSL::SSL
127125 Boost::system
128126 Boost::filesystem
129- Python3::Python
130127)
131128
132129set (LINK_GUI
@@ -136,7 +133,6 @@ set(LINK_GUI
136133set (INCLUDE_DIR
137134 ${CURL_INCLUDE_DIR}
138135 ${Boost_INCLUDE_DIRS}
139- ${Python3_INCLUDE_DIRS}
140136 libs/miniz
141137 libs/LIEF/include
142138 src
Original file line number Diff line number Diff line change @@ -26,21 +26,28 @@ QString decideExe(const QDir& dir) {
2626 QStringList exeFiles = dir.entryList (filters, QDir::Files);
2727
2828 for (const QString& file : exeFiles) {
29+ QString path = dir.filePath (file);
30+ std::string pathStr = path.toStdString ();
31+
32+ if (!LIEF::PE::is_pe (pathStr))
33+ continue ;
34+
2935 try {
3036 std::unique_ptr<LIEF::PE::Binary> binary =
31- LIEF::PE::Parser::parse (dir. filePath (file). toStdString () );
37+ LIEF::PE::Parser::parse (pathStr );
3238
3339 bool found = std::any_of (binary->imports ().begin (),
34- binary->imports ().end (), [](const LIEF::PE::Import& imp) {
35- return imp.name () == " DDRAW.dll" || imp.name () == " d3d11.dll" ;
36- });
40+ binary->imports ().end (), [](const LIEF::PE::Import& imp) {
41+ return imp.name () == " DDRAW.dll" ||
42+ imp.name () == " d3d11.dll" ;
43+ });
3744
3845 if (found) {
3946 fileName = file;
4047 break ;
4148 }
4249 } catch (const std::exception& e) {
43- std::cerr << " Error : " << e.what () << std::endl;
50+ std::cerr << " LIEF parse error : " << e.what () << std::endl;
4451 }
4552 }
4653
You can’t perform that action at this time.
0 commit comments