Skip to content

Commit

Permalink
Fix a wrong full path of hidden node
Browse files Browse the repository at this point in the history
  • Loading branch information
dmknght committed Oct 27, 2024
1 parent 6bb3d81 commit b4d0520
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/engine/scan_file.nim
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ proc fscanner_scan_file*(scan_ctx: var FileScanCtx, scan_path: string, virname:
progress_bar_scan_file(scan_ctx.virt_scan_object)
discard cl_scanfile_callback(cstring(scan_ctx.scan_object), addr(virname), addr(scanned), scan_ctx.clam.engine, addr(scan_ctx.clam.options), addr(scan_ctx))


#[
Check hidden node by d_name's comparison.
Limitations:
Expand All @@ -137,7 +138,7 @@ 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
let full_node_path = if scan_dir.endsWith("/"): scan_dir & next_node_name else: scan_dir & "/" & next_node_name
scan_ctx.file_infected += 1
print_file_infected("Heur:Rootkit.HiddenOnDisk", full_node_path)

Expand Down

0 comments on commit b4d0520

Please sign in to comment.