From 01b7c154b51df52bd7b4451035dbc0040486756a Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:36:02 +0000 Subject: [PATCH 1/2] Should be good --- implants/lib/eldritch/src/sys/get_os_impl.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/implants/lib/eldritch/src/sys/get_os_impl.rs b/implants/lib/eldritch/src/sys/get_os_impl.rs index cba5d466f..b600ef869 100644 --- a/implants/lib/eldritch/src/sys/get_os_impl.rs +++ b/implants/lib/eldritch/src/sys/get_os_impl.rs @@ -39,11 +39,19 @@ pub fn get_os(starlark_heap: &Heap) -> Result { } fn handle_get_os() -> Result { + let tmp_platform = whoami::platform().to_string(); + let platform = String::from(match tmp_platform.to_lowercase().as_str() { + "linux" => "PLATFORM_LINUX", + "windows" => "PLATFORM_WINDOWS", + "mac os" => "PLATFORM_MACOS", + _ => tmp_platform.as_str(), + }); + Ok(OsInfo { arch: whoami::arch().to_string(), desktop_env: whoami::desktop_env().to_string(), distro: whoami::distro().to_string(), - platform: whoami::platform().to_string(), + platform, }) } From c34fc6ef72127fc3938a53f301c34c88e4bbc1c2 Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:16:52 +0000 Subject: [PATCH 2/2] Add BSD --- implants/lib/eldritch/src/sys/get_os_impl.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/implants/lib/eldritch/src/sys/get_os_impl.rs b/implants/lib/eldritch/src/sys/get_os_impl.rs index b600ef869..aef68e4cf 100644 --- a/implants/lib/eldritch/src/sys/get_os_impl.rs +++ b/implants/lib/eldritch/src/sys/get_os_impl.rs @@ -44,6 +44,7 @@ fn handle_get_os() -> Result { "linux" => "PLATFORM_LINUX", "windows" => "PLATFORM_WINDOWS", "mac os" => "PLATFORM_MACOS", + "bsd" => "PLATFORM_BSD", _ => tmp_platform.as_str(), });