From e7565b73c1a2ee28fd9cdc31ed03ee398c977e2c Mon Sep 17 00:00:00 2001 From: anemeth Date: Fri, 8 Mar 2024 10:04:05 -0800 Subject: [PATCH] Throw ddl not found exception when missing SharpHoundRPC on init --- src/CommonLib/CommonLib.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CommonLib/CommonLib.cs b/src/CommonLib/CommonLib.cs index 830c3e84..b8bd92be 100644 --- a/src/CommonLib/CommonLib.cs +++ b/src/CommonLib/CommonLib.cs @@ -1,4 +1,6 @@ -using Microsoft.Extensions.Logging; +using System; +using System.IO; +using Microsoft.Extensions.Logging; namespace SharpHoundCommonLib { @@ -24,6 +26,12 @@ public static void InitializeCommonLib(ILogger log = null, Cache cache = null) if (log != null) Logging.ConfigureLogging(log); + if (!File.Exists("SharpHoundRPC.dll")) + { + log.LogCritical("SharpHoundRPC.dll not found. Please reinstall and try again."); + throw new DllNotFoundException("SharpHoundRPC.dll not found."); + } + if (cache == null) { var newCache = Cache.CreateNewCache();