Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 794d15e

Browse files
committed
Mac - update full path calc with smear protection
1 parent e2712e5 commit 794d15e

File tree

1 file changed

+9
-4
lines changed
  • volatility/plugins/overlays/mac

1 file changed

+9
-4
lines changed

volatility/plugins/overlays/mac/mac.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,23 @@ def is_dir(self):
305305
def is_reg(self):
306306
return self.v_type == 1
307307

308-
def _do_calc_path(self, ret, vnodeobj, vname):
308+
def _do_calc_path(self, ret, vnodeobj, vname, vnode_offsets):
309309
if vnodeobj == None:
310310
return
311311

312+
if vnodeobj.v() in vnode_offsets:
313+
return
314+
315+
vnode_offsets.append(vnodeobj.v())
316+
312317
if vname:
313318
ret.append(vname)
314319

315320
if vnodeobj.v_flag.v() & 0x000001 != 0 and vnodeobj.v_mount.v() != 0:
316321
if vnodeobj.v_mount.mnt_vnodecovered.v() != 0:
317-
self._do_calc_path(ret, vnodeobj.v_mount.mnt_vnodecovered, vnodeobj.v_mount.mnt_vnodecovered.v_name)
322+
self._do_calc_path(ret, vnodeobj.v_mount.mnt_vnodecovered, vnodeobj.v_mount.mnt_vnodecovered.v_name, vnode_offsets)
318323
else:
319-
self._do_calc_path(ret, vnodeobj.v_parent, vnodeobj.v_parent.v_name)
324+
self._do_calc_path(ret, vnodeobj.v_parent, vnodeobj.v_parent.v_name, vnode_offsets)
320325

321326
def full_path(self):
322327
if self.v_flag.v() & 0x000001 != 0 and self.v_mount.v() != 0 and self.v_mount.mnt_flag.v() & 0x00004000 != 0:
@@ -325,7 +330,7 @@ def full_path(self):
325330
elements = []
326331
files = []
327332

328-
self._do_calc_path(elements, self, self.v_name)
333+
self._do_calc_path(elements, self, self.v_name, [])
329334
elements.reverse()
330335

331336
for e in elements:

0 commit comments

Comments
 (0)