From 6bb3d81476301ed89c57e54b3f97894133020a97 Mon Sep 17 00:00:00 2001 From: Nong Hoang Tu Date: Sun, 27 Oct 2024 17:11:58 +0700 Subject: [PATCH] Check full path of hidden node if dir doesn't end with / --- src/engine/scan_file.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/scan_file.nim b/src/engine/scan_file.nim index fd386e0..b0a2b19 100644 --- a/src/engine/scan_file.nim +++ b/src/engine/scan_file.nim @@ -137,8 +137,9 @@ proc fscanner_scan_file*(scan_ctx: var FileScanCtx, scan_path: string, virname: ]# proc fscanner_check_hidden_node(scan_ctx: var FileScanCtx, ptr_dir: ptr Dirent, scan_dir, current_node_name: string, next_node_name: var string) = if not isEmptyOrWhiteSpace(next_node_name) and next_node_name != current_node_name: + let full_node_path = if scan_dir.endsWith("/"): scan_dir & current_node_name else: scan_dir & "/" & current_node_name scan_ctx.file_infected += 1 - print_file_infected("Heur:Rootkit.HiddenOnDisk", scan_dir & next_node_name) + print_file_infected("Heur:Rootkit.HiddenOnDisk", full_node_path) # Get name of the next node if ptr_dir.d_reclen >= 256: