From eb5d564e7919b217b7a932fc7f9e576221e89574 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Mon, 8 Aug 2022 13:12:11 +0800 Subject: Use BinaryNinja::GetBundledPluginPath() to get the bundled plugin path. Close https://github.com/Vector35/binaryninja-api/issues/2982. --- examples/mlil_parser/src/mlil_parser.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'examples/mlil_parser/src/mlil_parser.cpp') diff --git a/examples/mlil_parser/src/mlil_parser.cpp b/examples/mlil_parser/src/mlil_parser.cpp index c31ec035..6122dbc7 100644 --- a/examples/mlil_parser/src/mlil_parser.cpp +++ b/examples/mlil_parser/src/mlil_parser.cpp @@ -8,27 +8,6 @@ using namespace BinaryNinja; using namespace std; -#ifndef _WIN32 - #include - #include -static string GetPluginsDirectory() -{ - Dl_info info; - if (!dladdr((void*)BNGetBundledPluginDirectory, &info)) - return NULL; - - stringstream ss; - ss << dirname((char*)info.dli_fname) << "/plugins/"; - return ss.str(); -} -#else -static string GetPluginsDirectory() -{ - return "C:\\Program Files\\Vector35\\BinaryNinja\\plugins\\"; -} -#endif - - static void PrintIndent(size_t indent) { for (size_t i = 0; i < indent; i++) @@ -257,10 +236,8 @@ int main(int argc, char* argv[]) } // In order to initiate the bundled plugins properly, the location - // of where bundled plugins directory is must be set. Since - // libbinaryninjacore is in the path get the path to it and use it to - // determine the plugins directory - SetBundledPluginDirectory(GetPluginsDirectory()); + // of where bundled plugins directory must be set + SetBundledPluginDirectory(GetBundledPluginDirectory()); InitPlugins(); Ref bd = new BinaryData(new FileMetadata(), argv[1]); -- cgit v1.3.1