From 291e18e82de36cd68e4e46e537fb5bf31786671a Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Wed, 14 Aug 2024 10:15:03 +0200 Subject: [IMP] Update BTB to understand MZ executables as well. Signed-off-by: Amlal EL Mahrouss --- src/manifest_builder.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/manifest_builder.cxx b/src/manifest_builder.cxx index efdb409..81f2c8e 100644 --- a/src/manifest_builder.cxx +++ b/src/manifest_builder.cxx @@ -5,12 +5,15 @@ // Created by Amlal on 6/20/24. // -#include +#include + #include + #include +#include + #include #include -#include using json = nlohmann::json; @@ -91,7 +94,7 @@ bool ManifestBuilder::buildJson(int arg_sz, const char* arg_val) std::cout << "buildme: error: can't open DLL/SO, it mayn't contain an entrypoint." << std::endl; return true; } - else if (target.ends_with(".lib")) + else if (target.ends_with(".dll")) { auto file = std::ifstream(target); std::stringstream ss; @@ -101,12 +104,15 @@ bool ManifestBuilder::buildJson(int arg_sz, const char* arg_val) ss.str()[1] == 'o' && ss.str()[2] == 'y' && ss.str()[3] == '!') - std::cout << "buildme: error: can't open PEF LIB, it mayn't contain an entrypoint." << std::endl; + std::cout << "buildme: error: can't open PEF DLL, it mayn't contain an entrypoint." << std::endl; else if (ss.str()[0] == '!' && ss.str()[1] == 'y' && ss.str()[2] == 'o' && ss.str()[3] == 'J') - std::cout << "buildme: error: can't open FEP LIB, it mayn't contain an entrypoint." << std::endl; + std::cout << "buildme: error: can't open FEP DLL, it mayn't contain an entrypoint." << std::endl; + else if (ss.str()[0] == 'M' && + ss.str()[1] == 'Z') + std::cout << "buildme: error: can't open MZ DLL, it mayn't contain an entrypoint." << std::endl; return true; } -- cgit v1.2.3