Fix YARA engine: remove unused Scanner import, fix compiler move issue, remove non-existent description field
This commit is contained in:
@@ -263,14 +263,13 @@ impl DetectionEngine {
|
||||
// YARA rule scanning
|
||||
if let Some(yara_engine) = &self.yara_engine {
|
||||
let yara_result = match tokio::runtime::Handle::try_current() {
|
||||
Ok(handle) => handle.block_on(async { yara_engine.scan_process(process, memory_regions).await }),
|
||||
Err(_) => {
|
||||
tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
.block_on(async { yara_engine.scan_process(process, memory_regions).await })
|
||||
}
|
||||
Ok(handle) => handle
|
||||
.block_on(async { yara_engine.scan_process(process, memory_regions).await }),
|
||||
Err(_) => tokio::runtime::Runtime::new()
|
||||
.unwrap()
|
||||
.block_on(async { yara_engine.scan_process(process, memory_regions).await }),
|
||||
};
|
||||
|
||||
|
||||
if let Ok(yara_result) = yara_result {
|
||||
if !yara_result.matches.is_empty() {
|
||||
log::info!(
|
||||
|
||||
Reference in New Issue
Block a user